Commit 330bba62 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add "unlimit"

parent 2f4bc72d
......@@ -712,11 +712,16 @@ Note that the
factor is measure of security provided by the underlying transport,
e.g. ldapi:// (and eventually IPSEC). It is not normally used.
.TP
.B sizelimit <integer>
.B sizelimit {<integer>|unlimited}
.TP
.B sizelimit size[.{soft|hard|unchecked}]=<integer> [...]
Specify the maximum number of entries to return from a search operation.
The default size limit is 500.
Use
.B -1
or
.B unlimited
to specify no limits.
The second format allows a fine grain setting of the size limits.
Extra args can be added on the same line.
See
......@@ -740,12 +745,17 @@ meaningful if you are using Kerberos authentication.
Specify the maximum size of the primary thread pool.
The default is 32.
.TP
.B timelimit <integer>
.B timelimit {<integer>|unlimited}
.TP
.B timelimit time[.{soft|hard}]=<integer> [...]
Specify the maximum number of seconds (in real time)
.B slapd
will spend answering a search request. The default time limit is 3600.
Use
.B -1
or
.B unlimited
to specify no limits.
The second format allows a fine grain setting of the time limits.
Extra args can be added on the same line.
See
......
......@@ -664,25 +664,55 @@ read_config( const char *fname, int depth )
for ( i = 1; i < cargc; i++ ) {
if ( strncasecmp( cargv[i], "size", 4 ) == 0 ) {
rc = parse_limit( cargv[i], lim );
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: unable "
"to parse value \"%s\" in \"sizelimit "
"<limit>\" line.\n", fname, lineno, cargv[i] );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable "
"to parse value \"%s\" "
"in \"sizelimit "
"<limit>\" line\n",
fname, lineno, cargv[i] );
#endif
return( 1 );
}
} else {
lim->lms_s_soft = atoi( cargv[i] );
lim->lms_s_hard = 0;
}
if ( strcasecmp( cargv[i], "unlimited" ) == 0 ) {
lim->lms_s_soft = -1;
} else {
char *next;
if ( rc ) {
lim->lms_s_soft = strtol( cargv[i] , &next, 0 );
if ( next == cargv[i] ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: unable "
"to parse value \"%s\" in \"sizelimit "
"<limit>\" line.\n", fname, lineno, cargv[i] );
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: unable to parse limit \"%s\" in \"sizelimit <limit>\" "
"line.\n", fname, lineno, cargv[i] );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable "
"to parse value \"%s\" "
"in \"sizelimit "
"<limit>\" line\n",
fname, lineno, cargv[i] );
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to parse limit \"%s\" in \"sizelimit <limit>\" line\n",
fname, lineno, cargv[i] );
#endif
return( 1 );
} else if ( next[0] != '\0' ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: trailing chars \"%s\" in \"sizelimit <limit>\" "
"line ignored.\n", fname, lineno, next );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: trailing chars \"%s\" in \"sizelimit <limit>\" line ignored\n",
fname, lineno, next );
#endif
}
}
lim->lms_s_hard = 0;
}
}
......@@ -714,25 +744,55 @@ read_config( const char *fname, int depth )
for ( i = 1; i < cargc; i++ ) {
if ( strncasecmp( cargv[i], "time", 4 ) == 0 ) {
rc = parse_limit( cargv[i], lim );
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: unable to parse value \"%s\" "
"in \"timelimit <limit>\" line.\n",
fname, lineno, cargv[i] );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable "
"to parse value \"%s\" "
"in \"timelimit "
"<limit>\" line\n",
fname, lineno, cargv[i] );
#endif
return( 1 );
}
} else {
lim->lms_t_soft = atoi( cargv[i] );
lim->lms_t_hard = 0;
}
if ( strcasecmp( cargv[i], "unlimited" ) == 0 ) {
lim->lms_t_soft = -1;
} else {
char *next;
if ( rc ) {
lim->lms_t_soft = strtol( cargv[i] , &next, 0 );
if ( next == cargv[i] ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: unable to parse value \"%s\" "
"in \"timelimit <limit>\" line.\n",
fname, lineno, cargv[i] );
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: unable to parse limit \"%s\" in \"timelimit <limit>\" "
"line.\n", fname, lineno, cargv[i] );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable "
"to parse value \"%s\" "
"in \"timelimit "
"<limit>\" line\n",
fname, lineno, cargv[i] );
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to parse limit \"%s\" in \"timelimit <limit>\" line\n",
fname, lineno, cargv[i] );
#endif
return( 1 );
} else if ( next[0] != '\0' ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: trailing chars \"%s\" in \"timelimit <limit>\" "
"line ignored.\n", fname, lineno, next );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: trailing chars \"%s\" in \"timelimit <limit>\" line ignored\n",
fname, lineno, next );
#endif
}
}
lim->lms_t_hard = 0;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment