From 873c8f213bd35237b12c49de77df5f7145ff3cd8 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 21 Oct 1999 18:44:26 +0000 Subject: [PATCH] More acl parsing fixes... and print fixes. --- servers/slapd/aclparse.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index 362583dbb9..813c5d88ad 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -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,9 +541,14 @@ accessmask2str( slap_access_mask_t mask ) } if ( none && ACL_PRIV_ISSET(mask, ACL_PRIV_NONE) ) { - strcat( buf, "0" ); + none = 0; + strcat( buf, "n" ); } + if ( none ) { + strcat( buf, "0" ); + } + if ( ACL_IS_LEVEL( mask ) ) { strcat(buf, ")"); } @@ -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" ); } -- 2.39.5