- if ( (e = re_comp( right )) != NULL ) {
- fprintf( stderr,
- "%s: line %d: regular expression \"%s\" bad: %s\n",
- fname, lineno, right, e );
- acl_usage();
- }
- b->a_dnpat = dn_upcase( strdup( right ) );
- } else if ( strcasecmp( left, "dnattr" )
- == 0 ) {
- b->a_dnattr = strdup( right );
- } else if ( strcasecmp( left, "domain" )
- == 0 ) {
+ regtest(fname, lineno, right);
+ b->a_dnpat = dn_upcase( ch_strdup( right ) );
+ } else if ( strcasecmp( left, "dnattr" ) == 0 ) {
+ b->a_dnattr = ch_strdup( right );
+
+#ifdef SLAPD_ACLGROUPS
+ } else if ( strcasecmp( left, "group" ) == 0 ) {
+ char *name = NULL;
+ char *value = NULL;
+ regtest(fname, lineno, right);
+
+ /* format of string is "group/objectClassValue/groupAttrName"
+ */
+ if ((value = strchr(right, '/')) != NULL) {
+ *value++ = '\0';
+ if (value && *value && (name = strchr(value, '/')) != NULL)
+ *name++ = '\0';
+ }
+
+ b->a_group = dn_upcase(ch_strdup( right ));
+
+ if (value && *value) {
+ b->a_objectclassvalue = ch_strdup(value);
+ *--value = '/';
+ }
+ else
+ b->a_objectclassvalue = ch_strdup("groupOfNames");
+
+ if (name && *name) {
+ b->a_groupattrname = ch_strdup(name);
+ *--name = '/';
+ }
+ else
+ b->a_groupattrname = ch_strdup("member");
+
+
+
+#endif /* SLAPD_ACLGROUPS */
+ } else if ( strcasecmp( left, "domain" ) == 0 ) {