X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Faclparse.c;h=a4b8ed850f1456d1fa1edd3ebc8cb2e1dce5eb6f;hb=21be582df7e13ae2c8d44e1f7f02478eb9ec0762;hp=fce8a116981f9ea327abc7fca2e9b1a81b108cc8;hpb=183b696e762dace3f9f1c5d90da6d4fef91e4084;p=openldap diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index fce8a11698..a4b8ed850f 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2005 The OpenLDAP Foundation. + * Copyright 1998-2006 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -325,7 +325,7 @@ parse_acl( int pos ) { int i; - char *left, *right, *style, *next; + char *left, *right, *style; struct berval bv; AccessControl *a; Access *b; @@ -475,7 +475,8 @@ parse_acl( } } else if ( strncasecmp( left, "val", 3 ) == 0 ) { - char *mr; + struct berval bv; + char *mr; if ( !BER_BVISEMPTY( &a->acl_attrval ) ) { Debug( LDAP_DEBUG_ANY, @@ -491,7 +492,7 @@ parse_acl( return acl_usage(); } - ber_str2bv( right, 0, 1, &a->acl_attrval ); + ber_str2bv( right, 0, 0, &bv ); a->acl_attrval_style = ACL_STYLE_BASE; mr = strchr( left, '/' ); @@ -525,7 +526,7 @@ parse_acl( if ( style != NULL ) { if ( strcasecmp( style, "regex" ) == 0 ) { - int e = regcomp( &a->acl_attrval_re, a->acl_attrval.bv_val, + int e = regcomp( &a->acl_attrval_re, bv.bv_val, REG_EXTENDED | REG_ICASE | REG_NOSUB ); if ( e ) { char err[SLAP_TEXT_BUFLEN], @@ -553,8 +554,6 @@ parse_acl( } else if ( a->acl_attrs[0].an_desc->ad_type-> sat_syntax == slap_schema.si_syn_distinguishedName ) { - struct berval bv; - if ( !strcasecmp( style, "baseObject" ) || !strcasecmp( style, "base" ) ) { @@ -576,8 +575,10 @@ parse_acl( snprintf( buf, sizeof( buf ), "unknown val.