} else if ( !strncasecmp( cargv[ i ],
INTERVALSTR, sizeof( INTERVALSTR ) - 1 ) )
{
- char *hstr;
- char *mstr;
- char *dstr;
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;
+ 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;
}
- *mstr++ = '\0';
- si->si_interval = (( atoi( dstr ) * 24 + atoi( hstr )) * 60
- + atoi( mstr )) * 60;
-
if ( si->si_interval < 0 ) {
fprintf( stderr, "Error: parse_syncrepl_line: "
"invalid interval \"%ld\"\n",
exit $RC
fi
-echo "Waiting 90 seconds for syncrepl to receive changes..."
-sleep 90
+echo "Waiting 15 seconds for syncrepl to receive changes..."
+sleep 15
echo "Using ldapmodify to modify master directory..."
exit $RC
fi
-echo "Waiting 90 seconds for syncrepl to receive changes..."
-sleep 90
+echo "Waiting 15 seconds for syncrepl to receive changes..."
+sleep 15
echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
exit $RC
fi
-echo "Waiting 20 seconds for syncrepl to receive changes..."
-sleep 20
+echo "Waiting 15 seconds for syncrepl to receive changes..."
+sleep 15
echo "Using ldapmodify to modify master directory..."
exit $RC
fi
-echo "Waiting 20 seconds for syncrepl to receive changes..."
-sleep 20
+echo "Waiting 15 seconds for syncrepl to receive changes..."
+sleep 15
echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
exit $RC
fi
-echo "Waiting 90 seconds for syncrepl to receive changes..."
-sleep 90
+echo "Waiting 25 seconds for syncrepl to receive changes..."
+sleep 25
echo "Using ldapmodify to modify master directory..."
exit $RC
fi
-echo "Waiting 90 seconds for syncrepl to receive changes..."
-sleep 90
+echo "Waiting 25 seconds for syncrepl to receive changes..."
+sleep 25
echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \