}
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
- for (g = conn->c_groups; g; g=g->next) {
- if (g->be != be || g->oc != group_oc || g->at != group_at ||
- g->len != gr_ndn->bv_len)
+ for (g = conn->c_groups; g; g=g->ga_next) {
+ if (g->ga_be != be || g->ga_oc != group_oc ||
+ g->ga_at != group_at || g->ga_len != gr_ndn->bv_len)
continue;
- if (strcmp( g->ndn, gr_ndn->bv_val ) == 0)
+ if (strcmp( g->ga_ndn, gr_ndn->bv_val ) == 0)
break;
}
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
- if (g)
- return g->res;
+ if (g) {
+ return g->ga_res;
+ }
if( be->be_group ) {
int res = be->be_group( be, conn, op,
if (op->o_tag != LDAP_REQ_BIND) {
g = ch_malloc(sizeof(GroupAssertion) + gr_ndn->bv_len);
- g->be = be;
- g->oc = group_oc;
- g->at = group_at;
- g->res = res;
- g->len = gr_ndn->bv_len;
- strcpy(g->ndn, gr_ndn->bv_val);
+ g->ga_be = be;
+ g->ga_oc = group_oc;
+ g->ga_at = group_at;
+ g->ga_res = res;
+ g->ga_len = gr_ndn->bv_len;
+ strcpy(g->ga_ndn, gr_ndn->bv_val);
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
- g->next = conn->c_groups;
+ g->ga_next = conn->c_groups;
conn->c_groups = g;
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
}
#endif
return( rc );
}
- reg->match = nbv.bv_val;
+ reg->sr_match = nbv.bv_val;
ber_str2bv( replace, 0, 0, &bv );
rc = dnNormalize2( NULL, &bv, &nbv );
#endif
return( rc );
}
- reg->replace = nbv.bv_val;
+ reg->sr_replace = nbv.bv_val;
/* Precompile matching pattern */
- rc = regcomp( ®->workspace, reg->match, REG_EXTENDED|REG_ICASE );
+ rc = regcomp( ®->sr_workspace, reg->sr_match, REG_EXTENDED|REG_ICASE );
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "sasl", LDAP_LEVEL_ERR,
"slap_sasl_regexp_config: \"%s\" could not be compiled.\n",
- reg->match ));
+ reg->sr_match ));
#else
Debug( LDAP_DEBUG_ANY,
"SASL match pattern %s could not be compiled by regexp engine\n",
- reg->match, 0, 0 );
+ reg->sr_match, 0, 0 );
#endif
return( LDAP_OPERATIONS_ERROR );
}
/* Precompile replace pattern. Find the $<n> placeholders */
- reg->offset[0] = -2;
+ reg->sr_offset[0] = -2;
n = 1;
- for ( c = reg->replace; *c; c++ ) {
+ for ( c = reg->sr_replace; *c; c++ ) {
if ( *c == '\\' ) {
c++;
continue;
if ( n == SASLREGEX_REPLACE ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "sasl", LDAP_LEVEL_ERR,
- "slap_sasl_regexp_config: \"%s\" has too many $n placeholders (max %d)\n",
- reg->replace, SASLREGEX_REPLACE ));
+ "slap_sasl_regexp_config: \"%s\" has too many $n "
+ "placeholders (max %d)\n",
+ reg->sr_replace, SASLREGEX_REPLACE ));
#else
Debug( LDAP_DEBUG_ANY,
- "SASL replace pattern %s has too many $n placeholders (max %d)\n",
- reg->replace, SASLREGEX_REPLACE, 0 );
+ "SASL replace pattern %s has too many $n "
+ "placeholders (max %d)\n",
+ reg->sr_replace, SASLREGEX_REPLACE, 0 );
#endif
return( LDAP_OPERATIONS_ERROR );
}
- reg->offset[n] = c - reg->replace;
+ reg->sr_offset[n] = c - reg->sr_replace;
n++;
}
}
/* Final placeholder, after the last $n */
- reg->offset[n] = c - reg->replace;
+ reg->sr_offset[n] = c - reg->sr_replace;
n++;
- reg->offset[n] = -1;
+ reg->sr_offset[n] = -1;
nSaslRegexp++;
#endif
/* Match the normalized SASL name to the saslregexp patterns */
for( reg = SaslRegexp,i=0; i<nSaslRegexp; i++,reg++ ) {
- if ( regexec( ®->workspace, saslname, SASLREGEX_REPLACE,
- reg->strings, 0) == 0 )
+ if ( regexec( ®->sr_workspace, saslname, SASLREGEX_REPLACE,
+ reg->sr_strings, 0) == 0 )
break;
}
n=1;
len = 0;
- while( reg->offset[n] >= 0 ) {
+ while( reg->sr_offset[n] >= 0 ) {
/* Len of next section from replacement string (x,y,z above) */
- len += reg->offset[n] - reg->offset[n-1] - 2;
- if( reg->offset[n+1] < 0)
+ len += reg->sr_offset[n] - reg->sr_offset[n-1] - 2;
+ if( reg->sr_offset[n+1] < 0)
break;
/* Len of string from saslname that matched next $i (b,d above) */
- i = reg->replace[ reg->offset[n] + 1 ] - '0';
- len += reg->strings[i].rm_eo - reg->strings[i].rm_so;
+ i = reg->sr_replace[ reg->sr_offset[n] + 1 ] - '0';
+ len += reg->sr_strings[i].rm_eo - reg->sr_strings[i].rm_so;
n++;
}
uri = ch_malloc( len + 1 );
/* Fill in URI with replace string, replacing $i as we go */
n=1;
insert = 0;
- while( reg->offset[n] >= 0) {
+ while( reg->sr_offset[n] >= 0) {
/* Paste in next section from replacement string (x,y,z above) */
- len = reg->offset[n] - reg->offset[n-1] - 2;
- strncpy( uri+insert, reg->replace + reg->offset[n-1] + 2, len);
+ len = reg->sr_offset[n] - reg->sr_offset[n-1] - 2;
+ strncpy( uri+insert, reg->sr_replace + reg->sr_offset[n-1] + 2, len);
insert += len;
- if( reg->offset[n+1] < 0)
+ if( reg->sr_offset[n+1] < 0)
break;
/* Paste in string from saslname that matched next $i (b,d above) */
- i = reg->replace[ reg->offset[n] + 1 ] - '0';
- len = reg->strings[i].rm_eo - reg->strings[i].rm_so;
- strncpy( uri+insert, saslname + reg->strings[i].rm_so, len );
+ i = reg->sr_replace[ reg->sr_offset[n] + 1 ] - '0';
+ len = reg->sr_strings[i].rm_eo - reg->sr_strings[i].rm_so;
+ strncpy( uri+insert, saslname + reg->sr_strings[i].rm_so, len );
insert += len;
n++;
#define f_sub_final f_un.f_un_ssa->sa_final
#define f_mra f_un.f_un_mra
#define f_mr_rule f_un.f_un_mra->ma_rule
-#define f_mr_rule_text f_un.f_un_mra->ma_rule_text
+#define f_mr_rule_text f_un.f_un_mra->ma_rule_text
#define f_mr_desc f_un.f_un_mra->ma_desc
#define f_mr_value f_un.f_un_mra->ma_value
#define f_mr_dnattrs f_un.f_un_mra->ma_dnattrs
char o_subentries_visibility;
char o_noop;
- int o_abandon; /* abandon flag */
+ char o_abandon; /* abandon flag */
ldap_pvt_thread_mutex_t o_abandonmutex; /* protects o_abandon */
#ifdef LDAP_CONNECTIONLESS
* Caches the result of a backend_group check for ACL evaluation
*/
typedef struct slap_gacl {
- struct slap_gacl *next;
- Backend *be;
- ObjectClass *oc;
- AttributeDescription *at;
- int res;
- ber_len_t len;
- char ndn[1];
+ struct slap_gacl *ga_next;
+ Backend *ga_be;
+ ObjectClass *ga_oc;
+ AttributeDescription *ga_at;
+ int ga_res;
+ ber_len_t ga_len;
+ char ga_ndn[1];
} GroupAssertion;
/*
void *c_sasl_context; /* SASL session context */
void *c_sasl_extra; /* SASL session extra stuff */
- long c_n_ops_received; /* num of ops received (next op_id) */
+ long c_n_ops_received; /* num of ops received (next op_id) */
long c_n_ops_executing; /* num of ops currently executing */
- long c_n_ops_pending; /* num of ops pending execution */
+ long c_n_ops_pending; /* num of ops pending execution */
long c_n_ops_completed; /* num of ops completed */
long c_n_get; /* num of get calls */
#define SASL_AUTHZ_DEST_ATTR "saslAuthzFrom"
typedef struct sasl_regexp {
- char *match; /* regexp match pattern */
- char *replace; /* regexp replace pattern */
- regex_t workspace; /* workspace for regexp engine */
- regmatch_t strings[SASLREGEX_REPLACE]; /* strings matching $1,$2 ... */
- int offset[SASLREGEX_REPLACE+2]; /* offsets of $1,$2... in *replace */
+ char *sr_match; /* regexp match pattern */
+ char *sr_replace; /* regexp replace pattern */
+ regex_t sr_workspace; /* workspace for regexp engine */
+ regmatch_t sr_strings[SASLREGEX_REPLACE]; /* strings matching $1,$2 ... */
+ int sr_offset[SASLREGEX_REPLACE+2]; /* offsets of $1,$2... in *replace */
} SaslRegexp_t;
/*