From: Pierangelo Masarati Date: Mon, 22 Aug 2005 16:28:50 +0000 (+0000) Subject: allow options in dynacl configuration X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~614 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=849ecbcf1fa25b73bcc019150d332f8c1a1d37d4;p=openldap allow options in dynacl configuration --- diff --git a/servers/slapd/aci.c b/servers/slapd/aci.c index 01c2691d03..012d829fcf 100644 --- a/servers/slapd/aci.c +++ b/servers/slapd/aci.c @@ -608,7 +608,13 @@ aci_init( void ) * umbrella, because sets share some helpers with ACIs. */ static int -dynacl_aci_parse( const char *fname, int lineno, slap_style_t sty, const char *right, void **privp ) +dynacl_aci_parse( + const char *fname, + int lineno, + const char *opts, + slap_style_t sty, + const char *right, + void **privp ) { AttributeDescription *ad = NULL; const char *text = NULL; diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index 1c9a4354d7..e307b550c5 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -70,7 +70,14 @@ static int check_scope( BackendDB *be, AccessControl *a ); #ifdef SLAP_DYNACL static int -slap_dynacl_config( const char *fname, int lineno, Access *b, const char *name, slap_style_t sty, const char *right ) +slap_dynacl_config( + const char *fname, + int lineno, + Access *b, + const char *name, + const char *opts, + slap_style_t sty, + const char *right ) { slap_dynacl_t *da, *tmp; int rc = 0; @@ -93,7 +100,7 @@ slap_dynacl_config( const char *fname, int lineno, Access *b, const char *name, *tmp = *da; if ( tmp->da_parse ) { - rc = ( *tmp->da_parse )( fname, lineno, sty, right, &tmp->da_private ); + rc = ( *tmp->da_parse )( fname, lineno, opts, sty, right, &tmp->da_private ); if ( rc ) { ch_free( tmp ); return rc; @@ -1490,17 +1497,23 @@ parse_acl( #ifdef SLAP_DYNACL { - char *name = NULL; + char *name = NULL, + *opts = NULL; if ( strcasecmp( left, "aci" ) == 0 ) { name = "aci"; } else if ( strncasecmp( left, "dynacl/", STRLENOF( "dynacl/" ) ) == 0 ) { name = &left[ STRLENOF( "dynacl/" ) ]; + opts = strchr( name, '/' ); + if ( opts ) { + opts[ 0 ] = '\0'; + opts++; + } } if ( name ) { - if ( slap_dynacl_config( fname, lineno, b, name, sty, right ) ) { + if ( slap_dynacl_config( fname, lineno, b, name, opts, sty, right ) ) { fprintf( stderr, "%s: line %d: " "unable to configure dynacl \"%s\"\n", fname, lineno, name ); @@ -2122,7 +2135,7 @@ acl_usage( void ) "\t[aci[=]]\n" #endif #ifdef SLAP_DYNACL - "\t[dynacl/[.][=]]\n" + "\t[dynacl/[/][.][=]]\n" #endif /* SLAP_DYNACL */ "\t[ssf=] [transport_ssf=] [tls_ssf=] [sasl_ssf=]\n", "