From: Jong Hyuk Choi Date: Fri, 18 Jun 2004 02:59:47 +0000 (+0000) Subject: revert pervious change X-Git-Tag: OPENDLAP_REL_ENG_2_2_MP~254 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ef0a4047299dbb433e24e884459344f148933a7b;p=openldap revert pervious change --- diff --git a/servers/slapd/config.c b/servers/slapd/config.c index a144b6cd57..7aceee21eb 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -3332,48 +3332,51 @@ parse_syncrepl_line( } else if ( !strncasecmp( cargv[ i ], INTERVALSTR, sizeof( INTERVALSTR ) - 1 ) ) { - char *hstr; - char *mstr; - char *dstr; - char *sstr; - int dd, hh, mm, ss; val = cargv[ i ] + sizeof( INTERVALSTR ); - dstr = val; - hstr = strchr( dstr, ':' ); - if ( hstr == NULL ) { - fprintf( stderr, "Error: parse_syncrepl_line: " - "invalid interval \"%s\"\n", val ); - return 1; - } - *hstr++ = '\0'; - mstr = strchr( hstr, ':' ); - if ( mstr == NULL ) { - fprintf( stderr, "Error: parse_syncrepl_line: " - "invalid interval \"%s\"\n", val ); - return 1; - } - *mstr++ = '\0'; - sstr = strchr( mstr, ':' ); - if ( sstr == NULL ) { - fprintf( stderr, "Error: parse_syncrepl_line: " - "invalid interval \"%s\"\n", val ); - return 1; - } - *sstr++ = '\0'; - - dd = atoi( dstr ); - hh = atoi( hstr ); - mm = atoi( mstr ); - ss = atoi( sstr ); - if (( hh > 24 ) || ( hh < 0 ) || - ( mm > 60 ) || ( mm < 0 ) || - ( ss > 60 ) || ( ss < 0 ) || ( dd < 0 )) { - fprintf( stderr, "Error: parse_syncrepl_line: " - "invalid interval \"%s\"\n", val ); - return 1; + if ( si->si_type == LDAP_SYNC_REFRESH_AND_PERSIST ) { + si->si_interval = 0; + } else { + char *hstr; + char *mstr; + char *dstr; + char *sstr; + int dd, hh, mm, ss; + dstr = val; + hstr = strchr( dstr, ':' ); + if ( hstr == NULL ) { + fprintf( stderr, "Error: parse_syncrepl_line: " + "invalid interval \"%s\"\n", val ); + return 1; + } + *hstr++ = '\0'; + mstr = strchr( hstr, ':' ); + if ( mstr == NULL ) { + fprintf( stderr, "Error: parse_syncrepl_line: " + "invalid interval \"%s\"\n", val ); + return 1; + } + *mstr++ = '\0'; + sstr = strchr( mstr, ':' ); + if ( sstr == NULL ) { + fprintf( stderr, "Error: parse_syncrepl_line: " + "invalid interval \"%s\"\n", val ); + return 1; + } + *sstr++ = '\0'; + + dd = atoi( dstr ); + hh = atoi( hstr ); + mm = atoi( mstr ); + ss = atoi( sstr ); + if (( hh > 24 ) || ( hh < 0 ) || + ( mm > 60 ) || ( mm < 0 ) || + ( ss > 60 ) || ( ss < 0 ) || ( dd < 0 )) { + fprintf( stderr, "Error: parse_syncrepl_line: " + "invalid interval \"%s\"\n", val ); + return 1; + } + si->si_interval = (( dd * 24 + hh ) * 60 + mm ) * 60 + ss; } - si->si_interval = (( dd * 24 + hh ) * 60 + mm ) * 60 + ss; - if ( si->si_interval < 0 ) { fprintf( stderr, "Error: parse_syncrepl_line: " "invalid interval \"%ld\"\n",