Commit 09a7bd43 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Clean up asserts, should assert desc != NULL instead of attr != NULL

parent 241d6a55
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment