split( argv[i], '=', &left, &right );
if ( strcasecmp( argv[i], "*" ) == 0 ) {
b->a_dnpat = ch_strdup( ".*" );
+ } else if ( strcasecmp( argv[i], "anonymous" ) == 0 ) {
+ b->a_dnpat = ch_strdup( "anonymous" );
} else if ( strcasecmp( argv[i], "self" ) == 0 ) {
b->a_dnpat = ch_strdup( "self" );
} else if ( strcasecmp( left, "dn" ) == 0 ) {
} else if ( strcasecmp( left, "dnattr" ) == 0 ) {
b->a_dnattr = ch_strdup( right );
-#ifdef SLAPD_ACLGROUPS
} else if ( strncasecmp( left, "group", sizeof("group")-1 ) == 0 ) {
- char *name = NULL;
- char *value = NULL;
-
- /* format of string is "group/objectClassValue/groupAttrName"
- */
- if ((value = strchr(left, '/')) != NULL) {
- *value++ = '\0';
- if (value && *value && (name = strchr(value, '/')) != NULL)
- *name++ = '\0';
- }
+ char *name = NULL;
+ char *value = NULL;
+
+ /* format of string is "group/objectClassValue/groupAttrName" */
+ if ((value = strchr(left, '/')) != NULL) {
+ *value++ = '\0';
+ if (value && *value
+ && (name = strchr(value, '/')) != NULL)
+ {
+ *name++ = '\0';
+ }
+ }
regtest(fname, lineno, right);
b->a_group = dn_upcase(ch_strdup( right ));
- if (value && *value) {
- b->a_group_oc = ch_strdup(value);
- *--value = '/';
- }
- else
- b->a_group_oc = ch_strdup("groupOfNames");
-
- if (name && *name) {
- b->a_group_at = ch_strdup(name);
- *--name = '/';
- }
- else
- b->a_group_at = ch_strdup("member");
+ if (value && *value) {
+ b->a_group_oc = ch_strdup(value);
+ *--value = '/';
+ } else {
+ b->a_group_oc = ch_strdup("groupOfNames");
+ if (name && *name) {
+ b->a_group_at = ch_strdup(name);
+ *--name = '/';
+ } else {
+ b->a_group_at = ch_strdup("member");
+ }
+ }
-#endif /* SLAPD_ACLGROUPS */
} else if ( strcasecmp( left, "domain" ) == 0 ) {
char *s;
regtest(fname, lineno, right);
/* get <access> */
split( argv[i], '=', &left, &right );
- if ( ACL_IS_INVALID(ACL_SET(str2access( left ),b->a_access)) ) {
+ if ( ACL_IS_INVALID(ACL_SET(b->a_access,str2access( left ))) ) {
fprintf( stderr,
"%s: line %d: expecting <access> got \"%s\"\n",
fname, lineno, left );
if ( ACL_IS_NONE(access) ) {
strcat( buf, "none" );
-#ifdef SLAPD_ACLAUTH
} else if ( ACL_IS_AUTH(access) ) {
strcat( buf, "auth" );
-#endif
} else if ( ACL_IS_COMPARE(access) ) {
strcat( buf, "compare" );
} else if ( ACL_IS_SEARCH(access) ) {
strcat( buf, "read" );
} else if ( ACL_IS_WRITE(access) ) {
strcat( buf, "write" );
+
} else {
strcat( buf, "unknown" );
}
if ( strcasecmp( str, "none" ) == 0 ) {
ACL_SET_NONE(access);
-#ifdef SLAPD_ACLAUTH
} else if ( strcasecmp( str, "auth" ) == 0 ) {
ACL_SET_AUTH(access);
-#endif
} else if ( strcasecmp( str, "compare" ) == 0 ) {
ACL_SET_COMPARE(access);
} else if ( strcasecmp( str, "search" ) == 0 ) {
"<what> ::= * | [dn=<regex>] [filter=<ldapfilter>] [attrs=<attrlist>]\n"
"<attrlist> ::= <attr> | <attr> , <attrlist>\n"
"<attr> ::= <attrname> | entry | children\n"
- "<who> ::= * | self | dn=<regex> | addr=<regex>\n"
+ "<who> ::= * | anonymous | self | dn=<regex> | addr=<regex>\n"
"\t| domain=<regex> | dnattr=<dnattrname>\n"
-#ifdef SLAPD_ACLGROUPS
"\t| group[/<objectclass>[/<attrname>]]=<regex>\n"
-#endif
-#ifdef SLAPD_ACLAUTH
- "<access> ::= [self]{none|auth|compare|search|read|write}\n"
-#else
"<access> ::= [self]{none|auth|compare|search|read|write}\n"
-#endif
);
exit( 1 );
}
fprintf( stderr, "\tby" );
if ( b->a_dnpat != NULL ) {
- fprintf( stderr, " dn=%s", b->a_dnpat );
+ if( strcmp(b->a_dnpat, "anonymous") == 0 ) {
+ fprintf( stderr, " anonymous" );
+ } else if( strcmp(b->a_dnpat, "self") == 0 ) {
+ fprintf( stderr, " self" );
+ } else {
+ fprintf( stderr, " dn=%s", b->a_dnpat );
+ }
} else if ( b->a_addrpat != NULL ) {
fprintf( stderr, " addr=%s", b->a_addrpat );
} else if ( b->a_domainpat != NULL ) {
fprintf( stderr, " domain=%s", b->a_domainpat );
} else if ( b->a_dnattr != NULL ) {
fprintf( stderr, " dnattr=%s", b->a_dnattr );
- }
-#ifdef SLAPD_ACLGROUPS
- else if ( b->a_group != NULL ) {
- fprintf( stderr, " group: %s", b->a_group );
- if ( b->a_group_oc )
- fprintf( stderr, " objectClass: %s", b->a_group_oc );
- if ( b->a_group_at )
- fprintf( stderr, " attributeType: %s", b->a_group_at );
- }
-#endif
+ } else if ( b->a_group != NULL ) {
+ fprintf( stderr, " group: %s", b->a_group );
+ if ( b->a_group_oc ) {
+ fprintf( stderr, " objectClass: %s", b->a_group_oc );
+ if ( b->a_group_at ) {
+ fprintf( stderr, " attributeType: %s", b->a_group_at );
+ }
+ }
+ }
fprintf( stderr, "\n" );
}