mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
More acl parsing fixes... and print fixes.
This commit is contained in:
parent
9c5b7aa29d
commit
873c8f213b
@ -357,7 +357,7 @@ parse_acl(
|
||||
if( i == argc || ( strcasecmp( left, "stop" ) == 0 )) {
|
||||
/* out of arguments or plain stop */
|
||||
|
||||
ACL_PRIV_ASSIGN(b->a_mask, ACL_NONE);
|
||||
ACL_PRIV_ASSIGN(b->a_mask, ACL_PRIV_ADDITIVE);
|
||||
b->a_type = ACL_STOP;
|
||||
|
||||
access_append( &a->acl_access, b );
|
||||
@ -367,7 +367,7 @@ parse_acl(
|
||||
if( strcasecmp( left, "continue" ) == 0 ) {
|
||||
/* plain continue */
|
||||
|
||||
ACL_PRIV_ASSIGN(b->a_mask, ACL_NONE);
|
||||
ACL_PRIV_ASSIGN(b->a_mask, ACL_PRIV_ADDITIVE);
|
||||
b->a_type = ACL_CONTINUE;
|
||||
|
||||
access_append( &a->acl_access, b );
|
||||
@ -377,7 +377,7 @@ parse_acl(
|
||||
if( strcasecmp( left, "break" ) == 0 ) {
|
||||
/* plain continue */
|
||||
|
||||
ACL_PRIV_ASSIGN(b->a_mask, ACL_NONE);
|
||||
ACL_PRIV_ASSIGN(b->a_mask, ACL_PRIV_ADDITIVE);
|
||||
b->a_type = ACL_BREAK;
|
||||
|
||||
access_append( &a->acl_access, b );
|
||||
@ -387,7 +387,7 @@ parse_acl(
|
||||
if ( strcasecmp( left, "by" ) == 0 ) {
|
||||
/* we've gone too far */
|
||||
--i;
|
||||
ACL_PRIV_ASSIGN(b->a_mask, ACL_NONE);
|
||||
ACL_PRIV_ASSIGN(b->a_mask, ACL_PRIV_ADDITIVE);
|
||||
b->a_type = ACL_STOP;
|
||||
|
||||
access_append( &a->acl_access, b );
|
||||
@ -541,6 +541,11 @@ accessmask2str( slap_access_mask_t mask )
|
||||
}
|
||||
|
||||
if ( none && ACL_PRIV_ISSET(mask, ACL_PRIV_NONE) ) {
|
||||
none = 0;
|
||||
strcat( buf, "n" );
|
||||
}
|
||||
|
||||
if ( none ) {
|
||||
strcat( buf, "0" );
|
||||
}
|
||||
|
||||
@ -588,7 +593,7 @@ str2accessmask( const char *str )
|
||||
} else if( TOLOWER(str[i]) == 'x' ) {
|
||||
ACL_PRIV_SET(mask, ACL_PRIV_AUTH);
|
||||
|
||||
} else {
|
||||
} else if( str[i] != '0' ) {
|
||||
ACL_INVALIDATE(mask);
|
||||
return mask;
|
||||
}
|
||||
@ -740,6 +745,16 @@ print_access( Access *b )
|
||||
b->a_dn_self ? "self" : "",
|
||||
accessmask2str( b->a_mask ) );
|
||||
|
||||
if( b->a_type == ACL_BREAK ) {
|
||||
fprintf( stderr, " break" );
|
||||
|
||||
} else if( b->a_type == ACL_CONTINUE ) {
|
||||
fprintf( stderr, " continue" );
|
||||
|
||||
} else if( b->a_type != ACL_STOP ) {
|
||||
fprintf( stderr, " unknown-control" );
|
||||
}
|
||||
|
||||
fprintf( stderr, "\n" );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user