+ if ( limit.lms_s_hard > 0 && limit.lms_s_hard < limit.lms_s_soft ) {
+ limit.lms_s_hard = limit.lms_s_soft;
+ }
+
+ return( add_limits( be, type, pattern, &limit ) );
+}
+
+int
+parse_limit(
+ const char *arg,
+ struct slap_limits_set *limit
+)
+{
+ assert( arg );
+ assert( limit );
+
+ if ( strncasecmp( arg, "time", 4 ) == 0 ) {
+ arg += 4;
+
+ if ( arg[0] == '.' ) {
+ arg++;
+ if ( strncasecmp( arg, "soft", 4 ) == 0 ) {
+ arg += 4;
+ if ( arg[0] != '=' ) {
+ return( 1 );
+ }
+ arg++;
+ limit->lms_t_soft = atoi( arg );
+
+ } else if ( strncasecmp( arg, "hard", 4 ) == 0 ) {
+ arg += 4;
+ if ( arg[0] != '=' ) {
+ return( 1 );
+ }
+ arg++;
+ if ( strcasecmp( arg, "soft" ) == 0 ) {
+ limit->lms_t_hard = 0;
+ } else if ( strcasecmp( arg, "none" ) == 0 ) {
+ limit->lms_t_hard = -1;
+ } else {
+ limit->lms_t_hard = atoi( arg );
+ }
+
+ } else {
+ return( 1 );
+ }
+
+ } else if ( arg[0] == '=' ) {
+ limit->lms_t_soft = atoi( arg );
+ limit->lms_t_hard = 0;
+
+ } else {
+ return( 1 );
+ }
+
+ } else if ( strncasecmp( arg, "size", 4 ) == 0 ) {
+ arg += 4;
+
+ if ( arg[0] == '.' ) {
+ arg++;
+ if ( strncasecmp( arg, "soft", 4 ) == 0 ) {
+ arg += 4;
+ if ( arg[0] != '=' ) {
+ return( 1 );
+ }
+ arg++;
+ limit->lms_s_soft = atoi( arg );
+
+ } else if ( strncasecmp( arg, "hard", 4 ) == 0 ) {
+ arg += 4;
+ if ( arg[0] != '=' ) {
+ return( 1 );
+ }
+ arg++;
+ if ( strcasecmp( arg, "soft" ) == 0 ) {
+ limit->lms_s_hard = 0;
+ } else if ( strcasecmp( arg, "none" ) == 0 ) {
+ limit->lms_s_hard = -1;
+ } else {
+ limit->lms_s_hard = atoi( arg );
+ }
+
+ } else if ( strncasecmp( arg, "unchecked", 9 ) == 0 ) {
+ arg += 9;
+ if ( arg[0] != '=' ) {
+ return( 1 );
+ }
+ arg++;
+ if ( strcasecmp( arg, "none" ) == 0 ) {
+ limit->lms_s_unchecked = -1;
+ } else {
+ limit->lms_s_unchecked = atoi( arg );
+ }
+
+ } else {
+ return( 1 );
+ }
+
+ } else if ( arg[0] == '=' ) {
+ limit->lms_s_soft = atoi( arg );
+ limit->lms_s_hard = 0;
+
+ } else {
+ return( 1 );
+ }
+ }
+
+ return 0;