mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
Clean up asserts, should assert desc != NULL instead of attr != NULL
This commit is contained in:
parent
241d6a558e
commit
09a7bd4331
1 changed files with 25 additions and 11 deletions
|
|
@ -87,10 +87,16 @@ access_allowed(
|
|||
#endif
|
||||
slap_mask_t mask;
|
||||
slap_control_t control;
|
||||
const char *attr;
|
||||
regmatch_t matches[MAXREMATCHES];
|
||||
|
||||
const char *attr = desc ? desc->ad_cname->bv_val : NULL;
|
||||
assert( e != NULL );
|
||||
assert( desc != NULL );
|
||||
assert( access > ACL_NONE );
|
||||
|
||||
regmatch_t matches[MAXREMATCHES];
|
||||
attr = desc->ad_cname->bv_val;
|
||||
|
||||
assert( attr != NULL );
|
||||
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY,
|
||||
|
|
@ -103,10 +109,6 @@ access_allowed(
|
|||
e->e_dn, attr );
|
||||
#endif
|
||||
|
||||
assert( e != NULL );
|
||||
assert( attr != NULL );
|
||||
assert( access > ACL_NONE );
|
||||
|
||||
if ( op == NULL ) {
|
||||
/* no-op call */
|
||||
return 1;
|
||||
|
|
@ -289,8 +291,11 @@ acl_get(
|
|||
|
||||
assert( e != NULL );
|
||||
assert( count != NULL );
|
||||
assert( desc != NULL );
|
||||
|
||||
attr = desc ? desc->ad_cname->bv_val : NULL;
|
||||
attr = desc->ad_cname->bv_val;
|
||||
|
||||
assert( attr != NULL );
|
||||
|
||||
if( a == NULL ) {
|
||||
if( be == NULL ) {
|
||||
|
|
@ -453,10 +458,15 @@ acl_mask(
|
|||
#ifdef LDAP_DEBUG
|
||||
char accessmaskbuf[ACCESSMASK_MAXLEN];
|
||||
#endif
|
||||
const char *attr = desc ? desc->ad_cname->bv_val : NULL;
|
||||
const char *attr;
|
||||
|
||||
assert( a != NULL );
|
||||
assert( mask != NULL );
|
||||
assert( desc != NULL );
|
||||
|
||||
attr = desc->ad_cname->bv_val;
|
||||
|
||||
assert( attr != NULL );
|
||||
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY,
|
||||
|
|
@ -676,15 +686,17 @@ acl_mask(
|
|||
struct berval bv;
|
||||
int rc, match = 0;
|
||||
const char *text;
|
||||
const char *desc = b->a_dn_at->ad_cname->bv_val;
|
||||
const char *attr = b->a_dn_at->ad_cname->bv_val;
|
||||
|
||||
assert( attr != NULL );
|
||||
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
|
||||
"acl_mask: conn %d check a_dn_pat: %s\n",
|
||||
conn->c_connid, desc ));
|
||||
conn->c_connid, attr ));
|
||||
#else
|
||||
Debug( LDAP_DEBUG_ACL, "<= check a_dn_at: %s\n",
|
||||
desc, 0, 0);
|
||||
attr, 0, 0);
|
||||
#endif
|
||||
bv.bv_val = op->o_ndn;
|
||||
bv.bv_len = strlen( bv.bv_val );
|
||||
|
|
@ -1549,6 +1561,8 @@ aci_mask(
|
|||
int rc;
|
||||
char *attr = desc->ad_cname->bv_val;
|
||||
|
||||
assert( attr != NULL );
|
||||
|
||||
/* parse an aci of the form:
|
||||
oid#scope#action;rights;attr;rights;attr$action;rights;attr;rights;attr#dnType#subjectDN
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue