- if( right == NULL ) {
- /* no '=' */
- pat = ch_strdup( "users" );
-
- } else if (*right == '\0' ) {
- /* dn="" */
- pat = ch_strdup( "anonymous" );
-
- } else if ( strcmp( right, "*" ) == 0 ) {
- /* dn=* /
- /* any or users? any for now */
- pat = ch_strdup( "users" );
-
- } else if ( strcmp( right, ".+" ) == 0
- || strcmp( right, "^.+" ) == 0
- || strcmp( right, ".+$" ) == 0
- || strcmp( right, "^.+$" ) == 0
- || strcmp( right, ".+$$" ) == 0
- || strcmp( right, "^.+$$" ) == 0 )
- {
- pat = ch_strdup( "users" );
-
- } else if ( strcmp( right, ".*" ) == 0
- || strcmp( right, "^.*" ) == 0
- || strcmp( right, ".*$" ) == 0
- || strcmp( right, "^.*$" ) == 0
- || strcmp( right, ".*$$" ) == 0
- || strcmp( right, "^.*$$" ) == 0 )
- {
- pat = ch_strdup( "*" );
+ if ( sty == ACL_STYLE_REGEX ) {
+ b->a_dn_style = ACL_STYLE_REGEX;
+ if( right == NULL ) {
+ /* no '=' */
+ pat = ch_strdup( "users" );
+
+ } else if (*right == '\0' ) {
+ /* dn="" */
+ pat = ch_strdup( "anonymous" );
+
+ } else if ( strcmp( right, "*" ) == 0 ) {
+ /* dn=* */
+ /* any or users? users for now */
+ pat = ch_strdup( "users" );
+
+ } else if ( strcmp( right, ".+" ) == 0
+ || strcmp( right, "^.+" ) == 0
+ || strcmp( right, ".+$" ) == 0
+ || strcmp( right, "^.+$" ) == 0
+ || strcmp( right, ".+$$" ) == 0
+ || strcmp( right, "^.+$$" ) == 0 )
+ {
+ pat = ch_strdup( "users" );
+
+ } else if ( strcmp( right, ".*" ) == 0
+ || strcmp( right, "^.*" ) == 0
+ || strcmp( right, ".*$" ) == 0
+ || strcmp( right, "^.*$" ) == 0
+ || strcmp( right, ".*$$" ) == 0
+ || strcmp( right, "^.*$$" ) == 0 )
+ {
+ pat = ch_strdup( "*" );
+
+ } else {
+ regtest(fname, lineno, right);
+ pat = ch_strdup( right );
+ }
+ } else if ( right == NULL || *right == '\0' ) {
+ fprintf( stderr,
+ "%s: line %d: missing \"=\" in (or value after) \"%s\" in by clause\n",
+ fname, lineno, left );
+ acl_usage();