+
+ if ( which & SLAP_LIMIT_TIME ) {
+ if ( lim->lms_t_soft != SLAPD_DEFAULT_TIMELIMIT ) {
+
+ /* If same as global limit, drop it */
+ if ( lim != &frontendDB->be_def_limit &&
+ lim->lms_t_soft == frontendDB->be_def_limit.lms_t_soft )
+ {
+ goto t_hard;
+
+ /* If there's also a hard limit, fully qualify this one */
+ } else if ( lim->lms_t_hard ) {
+ if ( WHATSLEFT <= STRLENOF( " time.soft=" ) ) return -1;
+ ptr = lutil_strcopy( ptr, " time.soft=" );
+
+ /* If doing both size & time, qualify this */
+ } else if ( which & SLAP_LIMIT_SIZE ) {
+ if ( WHATSLEFT <= STRLENOF( " time=" ) ) return -1;
+ ptr = lutil_strcopy( ptr, " time=" );
+ }
+
+ if ( lim->lms_t_soft == -1 ) {
+ if ( WHATSLEFT <= STRLENOF( "unlimited" ) ) return -1;
+ ptr = lutil_strcopy( ptr, "unlimited" );
+ } else {
+ ptr += snprintf( ptr, WHATSLEFT, "%d", lim->lms_t_soft );
+ if ( WHATSLEFT < 0 ) return -1;
+ }
+ *ptr++ = ' ';
+ }
+t_hard:
+ if ( lim->lms_t_hard ) {
+ if ( WHATSLEFT <= STRLENOF( " time.hard=" ) ) return -1;
+ ptr = lutil_strcopy( ptr, " time.hard=" );
+ if ( lim->lms_t_hard == -1 ) {
+ if ( WHATSLEFT <= STRLENOF( "unlimited" ) ) return -1;
+ ptr = lutil_strcopy( ptr, "unlimited" );
+ } else {
+ ptr += snprintf( ptr, WHATSLEFT, "%d", lim->lms_t_hard );
+ if ( WHATSLEFT < 0 ) return -1;
+ }
+ *ptr++ = ' ';
+ }
+ }
+ if ( ptr != bv->bv_val ) {