cleanup DN style in limits

This commit is contained in:
Pierangelo Masarati 2004-03-08 13:13:30 +00:00
parent ac0d45179f
commit 4645eeb5ec
2 changed files with 73 additions and 23 deletions

View file

@ -298,7 +298,7 @@ anonymous | users | [dn[.<style>]=]<pattern> | group[/oc[/at]]=<pattern>
with with
.RS .RS
.TP .TP
<style> ::= exact | base | one | subtree | children | regex | anonymous <style> ::= exact | base | onelevel | subtree | children | regex | anonymous
.RE .RE
The term The term
@ -317,11 +317,11 @@ with
or or
.B base .B base
(which are synonyms), to require an exact match; with (which are synonyms), to require an exact match; with
.BR one, .BR onelevel ,
to require exactly one level of depth match; with to require exactly one level of depth match; with
.BR subtree, .BR subtree ,
to allow any level of depth match, including the exact match; with to allow any level of depth match, including the exact match; with
.BR children, .BR children ,
to allow any level of depth match, not including the exact match; to allow any level of depth match, not including the exact match;
.BR regex .BR regex
explicitly requires the (default) match based on regular expression explicitly requires the (default) match based on regular expression
@ -359,7 +359,7 @@ whose DN exactly matches
The currently supported limits are The currently supported limits are
.B size .B size
and and
.BR time. .BR time .
The syntax for time limits is The syntax for time limits is
.BR time[.{soft|hard}]=<integer> , .BR time[.{soft|hard}]=<integer> ,
@ -370,11 +370,17 @@ If no time limit is explicitly requested by the client, the
.BR soft .BR soft
limit is used; if the requested time limit exceeds the limit is used; if the requested time limit exceeds the
.BR hard .BR hard
limit, an "Administrative limit exceeded" is returned. limit, an
.I \"Administrative limit exceeded\"
is returned.
If the If the
.BR hard .BR hard
limit is set to 0 or to the keyword "soft", the soft limit is used limit is set to 0 or to the keyword
in either case; if it is set to -1 or to the keyword "none", .IR soft ,
the soft limit is used in either case; if it is set to
.I -1
or to the keyword
.IR none ,
no hard limit is enforced. no hard limit is enforced.
Explicit requests for time limits smaller or equal to the Explicit requests for time limits smaller or equal to the
.BR hard .BR hard
@ -395,11 +401,17 @@ If no size limit is explicitly requested by the client, the
.BR soft .BR soft
limit is used; if the requested size limit exceeds the limit is used; if the requested size limit exceeds the
.BR hard .BR hard
limit, an "Administrative limit exceeded" is returned. limit, an
.I \"Administrative limit exceeded\"
is returned.
If the If the
.BR hard .BR hard
limit is set to 0 or to the keyword "soft", the soft limit is used limit is set to 0 or to the keyword
in either case; if it is set to -1 or to the keyword "none", .IR soft ,
the soft limit is used in either case; if it is set to
.I -1
or to the keyword
.IR none ,
no hard limit is enforced. no hard limit is enforced.
Explicit requests for size limits smaller or equal to the Explicit requests for size limits smaller or equal to the
.BR hard .BR hard
@ -410,8 +422,13 @@ flag sets a limit on the number of candidates a search request is allowed
to examine. to examine.
If the selected candidates exceed the If the selected candidates exceed the
.BR unchecked .BR unchecked
limit, the search will abort with "Unwilling to perform". limit, the search will abort with
If it is set to -1 or to the keyword "none", no limit is applied (the default). .IR \"Unwilling to perform\" .
If it is set to
.I -1
or to the keyword
.IR none ,
no limit is applied (the default).
If no flag is set, the value is assigned to the If no flag is set, the value is assigned to the
.BR soft .BR soft
limit, and the limit, and the
@ -420,7 +437,7 @@ limit is set to zero, to preserve the original behavior.
In case of no match, the global limits are used. In case of no match, the global limits are used.
The default values are the same of The default values are the same of
.BR sizelimit .B sizelimit
and and
.BR timelimit ; .BR timelimit ;
no limit is set on no limit is set on
@ -433,7 +450,7 @@ control is defined, additional size limits may be enforced; the syntax is
where where
.BR integer .BR integer
is the max page size if no explicit limit is set; the keyword is the max page size if no explicit limit is set; the keyword
.BR noEstimate .IR noEstimate
inhibits the server to return an estimate of the total number inhibits the server to return an estimate of the total number
of entries that will be returned. of entries that will be returned.
.RE .RE

View file

@ -310,18 +310,19 @@ parse_limits(
* *
* "anonymous" * "anonymous"
* "users" * "users"
* [ "dn" [ "." { "exact" | "base" | "one" | "sub" | children" * [ "dn" [ "." { "exact" | "base" | "onelevel" | "subtree" | children"
* | "regex" | "anonymous" } ] "=" ] <dn pattern> * | "regex" | "anonymous" } ] "=" ] <dn pattern>
* *
* Note: * Note:
* "exact" and "base" are the same (exact match); * "exact" and "base" are the same (exact match);
* "one" means exactly one rdn below, NOT including the pattern * "onelevel" means exactly one rdn below, NOT including pattern
* "sub" means any rdn below, including the pattern * "subtree" means any rdn below, including pattern
* "children" means any rdn below, NOT including the pattern * "children" means any rdn below, NOT including pattern
* *
* "anonymous" may be deprecated in favour * "anonymous" may be deprecated in favour
* of the pattern = "anonymous" form * of the pattern = "anonymous" form
* *
* "group[/objectClass[/attributeType]]" "=" "<dn pattern>"
* *
* <limit>: * <limit>:
* *
@ -355,10 +356,42 @@ parse_limits(
} else if ( strncasecmp( pattern, "one", sizeof( "one" ) - 1 ) == 0 ) { } else if ( strncasecmp( pattern, "one", sizeof( "one" ) - 1 ) == 0 ) {
flags = SLAP_LIMITS_ONE; flags = SLAP_LIMITS_ONE;
pattern += sizeof( "one" ) - 1; pattern += sizeof( "one" ) - 1;
if ( strncasecmp( pattern, "level", sizeof( "level" ) - 1 ) == 0 ) {
pattern += sizeof( "level" ) - 1;
} else if ( strncasecmp( pattern, "subtree", sizeof( "subtree" ) - 1 ) == 0 ) { } else {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, WARNING ,
"%s : line %d: deprecated \"one\" style "
"\"limits <pattern> <limits>\" line; "
"use \"onelevel\" instead.\n", fname, lineno, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"%s : line %d: deprecated \"one\" style "
"\"limits <pattern> <limits>\" line; "
"use \"onelevel\" instead.\n", fname, lineno, 0 );
#endif
}
} else if ( strncasecmp( pattern, "sub", sizeof( "sub" ) - 1 ) == 0 ) {
flags = SLAP_LIMITS_SUBTREE; flags = SLAP_LIMITS_SUBTREE;
pattern += sizeof( "subtree" ) - 1; pattern += sizeof( "sub" ) - 1;
if ( strncasecmp( pattern, "tree", sizeof( "tree" ) - 1 ) == 0 ) {
pattern += sizeof( "tree" ) - 1;
} else {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, WARNING ,
"%s : line %d: deprecated \"sub\" style "
"\"limits <pattern> <limits>\" line; "
"use \"subtree\" instead.\n", fname, lineno, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"%s : line %d: deprecated \"sub\" style "
"\"limits <pattern> <limits>\" line; "
"use \"subtree\" instead.\n", fname, lineno, 0 );
#endif
}
} else if ( strncasecmp( pattern, "children", sizeof( "children" ) - 1 ) == 0 ) { } else if ( strncasecmp( pattern, "children", sizeof( "children" ) - 1 ) == 0 ) {
flags = SLAP_LIMITS_CHILDREN; flags = SLAP_LIMITS_CHILDREN;
@ -392,13 +425,13 @@ parse_limits(
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT, LDAP_LOG( CONFIG, CRIT,
"%s : line %d: missing '=' in " "%s : line %d: missing '=' in "
"\"dn[.{exact|base|one|subtree" "\"dn[.{exact|base|onelevel|subtree"
"|children|regex|anonymous}]" "=<pattern>\" in " "|children|regex|anonymous}]" "=<pattern>\" in "
"\"limits <pattern> <limits>\" line.\n", fname, lineno, 0 ); "\"limits <pattern> <limits>\" line.\n", fname, lineno, 0 );
#else #else
Debug( LDAP_DEBUG_ANY, Debug( LDAP_DEBUG_ANY,
"%s : line %d: missing '=' in " "%s : line %d: missing '=' in "
"\"dn[.{exact|base|one|subtree" "\"dn[.{exact|base|onelevel|subtree"
"|children|regex|anonymous}]" "|children|regex|anonymous}]"
"=<pattern>\" in " "=<pattern>\" in "
"\"limits <pattern> <limits>\" " "\"limits <pattern> <limits>\" "