]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/main.c
Berkeley DB 4.2 support (DB 4.2 required by default)
[openldap] / servers / slapd / main.c
index 61dc82e12186bb0210fdedbaf51460e4b5c37de8..c15dee8c1dae1c8ae0bf296ba77a8cb26dadc2f8 100644 (file)
@@ -92,6 +92,7 @@ usage( char *name )
        fprintf( stderr,
                "\t-4\t\tIPv4 only\n"
                "\t-6\t\tIPv6 only\n"
+               "\t-c cookie\tSync cookie of consumer\n"
                "\t-d level\tDebug level" "\n"
                "\t-f filename\tConfiguration file\n"
 #if defined(HAVE_SETUID) && defined(HAVE_SETGID)
@@ -144,6 +145,8 @@ int main( int argc, char **argv )
        char        *serverName = NULL;
        int         serverMode = SLAP_SERVER_MODE;
 
+       struct berval cookie = { 0, NULL };
+
 #ifdef CSRIMALLOC
        FILE *leakfile;
        if( ( leakfile = fopen( "slapd.leak", "w" )) == NULL ) {
@@ -214,7 +217,7 @@ int main( int argc, char **argv )
 #endif
 
        while ( (i = getopt( argc, argv,
-                            "d:f:h:s:n:t"
+                            "c:d:f:h:s:n:t"
 #if LDAP_PF_INET6
                                "46"
 #endif
@@ -243,6 +246,16 @@ int main( int argc, char **argv )
                        urls = ch_strdup( optarg );
            break;
 
+               case 'c':       /* provide sync cookie, override if exist in replica */
+                       if ( slap_sync_cookie ) {
+                               slap_sync_cookie_free( slap_sync_cookie, 1 );
+                       }
+                       slap_sync_cookie = (struct sync_cookie *) ch_calloc( 1,
+                                                               sizeof( struct sync_cookie ));
+                       ber_str2bv( optarg, strlen( optarg ), 1, &cookie );
+                       ber_bvarray_add( &slap_sync_cookie->octet_str, &cookie );
+                       break;
+
                case 'd':       /* set debug level and 'do not detach' flag */
                        no_detach = 1;
 #ifdef LDAP_DEBUG