}
break;
+ case SLAP_LIMITS_ANY:
+ *limit = &lm[0]->lm_limits;
+ return( 0 );
+
default:
assert( 0 ); /* unreachable */
return( -1 );
case SLAP_LIMITS_ANONYMOUS:
case SLAP_LIMITS_USERS:
+ case SLAP_LIMITS_ANY:
lm->lm_type = type;
lm->lm_dn_pat.bv_val = NULL;
lm->lm_dn_pat.bv_len = 0;
*/
pattern = argv[1];
- if ( strcasecmp( pattern, "anonymous" ) == 0 ) {
+ if ( strcmp( pattern, "*" ) == 0) {
+ type = SLAP_LIMITS_ANY;
+
+ } else if ( strcasecmp( pattern, "anonymous" ) == 0 ) {
type = SLAP_LIMITS_ANONYMOUS;
} else if ( strcasecmp( pattern, "users" ) == 0 ) {
/* skip '=' (required) */
pattern++;
+
+ /* trim obvious cases */
+ if ( strcmp( pattern, "*" ) == 0 ) {
+ type = SLAP_LIMITS_ANY;
+ pattern = NULL;
+
+ } else if ( ( type == SLAP_LIMITS_REGEX || type == SLAP_LIMITS_UNDEFINED )
+ && strcmp( pattern, ".*" ) == 0 ) {
+ type = SLAP_LIMITS_ANY;
+ pattern = NULL;
+ }
}
}
#define SLAP_LIMITS_REGEX 0x0005
#define SLAP_LIMITS_ANONYMOUS 0x0006
#define SLAP_LIMITS_USERS 0x0007
+#define SLAP_LIMITS_ANY 0x0008
regex_t lm_dn_regex; /* regex data for REGEX */
/*