From: Pierangelo Masarati Date: Tue, 16 Dec 2003 10:56:21 +0000 (+0000) Subject: improve error handling for attr val ACL syntax X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~172 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4e83a282d0ec607011a9e01ca71d73a81cdc0e4c;p=openldap improve error handling for attr val ACL syntax --- diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index 73ab0db634..67081a149f 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -38,6 +38,9 @@ #include "lber_pvt.h" #include "lutil.h" +static char *style_strings[] = { "regex", + "base", "one", "subtree", "children", NULL }; + static void split(char *line, int splitchar, char **left, char **right); static void access_append(Access **l, Access *a); static void acl_usage(void) LDAP_GCCATTR((noreturn)); @@ -280,30 +283,34 @@ parse_acl( a->acl_attrval_style = ACL_STYLE_REGEX; } else { /* FIXME: if the attribute has DN syntax, - * we might allow subtree and children styles as well */ + * we might allow one, subtree and children styles as well */ if ( !strcasecmp( style, "exact" ) ) { a->acl_attrval_style = ACL_STYLE_BASE; } else if ( a->acl_attrs[0].an_desc->ad_type->sat_syntax == slap_schema.si_syn_distinguishedName ) { if ( !strcasecmp( style, "base" ) ) { a->acl_attrval_style = ACL_STYLE_BASE; - } else if ( !strcasecmp( style, "children" ) ) { - a->acl_attrval_style = ACL_STYLE_CHILDREN; } else if ( !strcasecmp( style, "onelevel" ) || !strcasecmp( style, "one" ) ) { a->acl_attrval_style = ACL_STYLE_ONE; } else if ( !strcasecmp( style, "subtree" ) || !strcasecmp( style, "sub" ) ) { a->acl_attrval_style = ACL_STYLE_SUBTREE; + } else if ( !strcasecmp( style, "children" ) ) { + a->acl_attrval_style = ACL_STYLE_CHILDREN; } else { fprintf( stderr, - "%s: line %d: unknown val.