]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/aclparse.c
Cleanup
[openldap] / servers / slapd / aclparse.c
index 1679f2b0e8f16fbe0deb3ad9077ab602a28908ba..9a405660d7ac460b4737aaf9d58cfc801f50a357 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2008 The OpenLDAP Foundation.
+ * Copyright 1998-2009 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -528,7 +528,7 @@ parse_acl(
                                        if ( style != NULL ) {
                                                if ( strcasecmp( style, "regex" ) == 0 ) {
                                                        int e = regcomp( &a->acl_attrval_re, bv.bv_val,
-                                                               REG_EXTENDED | REG_ICASE | REG_NOSUB );
+                                                               REG_EXTENDED | REG_ICASE );
                                                        if ( e ) {
                                                                char    err[SLAP_TEXT_BUFLEN],
                                                                        buf[ SLAP_TEXT_BUFLEN ];
@@ -851,16 +851,6 @@ parse_acl(
                                        }
                                }
 
-                               /* expand in <who> needs regex in <what> */
-                               if ( ( sty == ACL_STYLE_EXPAND || expand )
-                                               && a->acl_dn_style != ACL_STYLE_REGEX )
-                               {
-                                       Debug( LDAP_DEBUG_CONFIG | LDAP_DEBUG_ACL, "%s: line %d: \"expand\" style "
-                                               "or modifier used in conjunction with a non-regex <what> clause.\n",
-                                               fname, lineno, 0 );
-                                               goto fail;
-                               }
-
                                if ( strncasecmp( left, "real", STRLENOF( "real" ) ) == 0 ) {
                                        is_realdn = 1;
                                        bdn = &b->a_realdn;
@@ -1004,7 +994,8 @@ parse_acl(
                                                                < bdn->a_pat.bv_len;
                                                        exp = strchr( exp, '$' ) )
                                                {
-                                                       if ( isdigit( (unsigned char) exp[ 1 ] ) ) {
+                                                       if ( ( isdigit( (unsigned char) exp[ 1 ] ) ||
+                                                                   exp[ 1 ] == '{' ) ) {
                                                                gotit = 1;
                                                                break;
                                                        }
@@ -2783,7 +2774,7 @@ acl_unparse( AccessControl *a, struct berval *bv )
                for ( an = a->acl_attrs; an && !BER_BVISNULL( &an->an_name ); an++ ) {
                        if ( ! first ) *ptr++ = ',';
                        if (an->an_oc) {
-                               *ptr++ = an->an_oc_exclude ? '!' : '@';
+                               *ptr++ = ( an->an_flags & SLAP_AN_OCEXCLUDE ) ? '!' : '@';
                                ptr = lutil_strcopy( ptr, an->an_oc->soc_cname.bv_val );
 
                        } else {