]> git.sur5r.net Git - openldap/commitdiff
for slurpd's replica directory (slurpd.status, and rej file) use a subdir of what...
authorBen Collins <bcollins@openldap.org>
Mon, 24 Apr 2000 17:03:23 +0000 (17:03 +0000)
committerBen Collins <bcollins@openldap.org>
Mon, 24 Apr 2000 17:03:23 +0000 (17:03 +0000)
servers/slurpd/args.c
servers/slurpd/globals.c
servers/slurpd/main.c

index c3b202065c67ed09a08fb16a134a301ff030665f..a807d8dd69d16c2a7fca236552bc10b3e49d5043 100644 (file)
@@ -105,7 +105,8 @@ doargs(
            rflag++;
            break;
        case 't':       /* dir to use for our copies of replogs */
-           g->slurpd_rdir = strdup( optarg );
+           g->slurpd_rdir = (char *)malloc (strlen(optarg) + strlen("/replica") + 1);
+           sprintf(g->slurpd_rdir, "%s/replica", optarg);
            break;
        case 'k':       /* name of kerberos srvtab file */
 #ifdef HAVE_KERBEROS
index fed3bbf31dcc605ff75fb3c86834e4952f82ef18..aebc413f8c4c57c32b5c445a8f4fa8ca1013e1e1 100644 (file)
@@ -48,7 +48,7 @@ init_globals( void )
     g->slurpd_shutdown = 0;
     g->num_replicas = 0;
     g->replicas = NULL;
-    g->slurpd_rdir = DEFAULT_SLURPD_REPLICA_DIR;
+    g->slurpd_rdir = DEFAULT_SLURPD_REPLICA_DIR "/replica";
     strcpy( g->slurpd_status_file, DEFAULT_SLURPD_STATUS_FILE );
     g->slapd_replogfile[ 0 ] = '\0';
     g->slurpd_replogfile[ 0 ] = '\0';
index cc094ba44670b69580276b5c9b7d410153777dfc..1510f21825b978a2226044f9f29c9d5c90b4c3d3 100644 (file)
@@ -65,6 +65,14 @@ main(
        exit( 1 );
     }
 
+    /* 
+     * Make sure our directory exists
+     */
+    if ( mkdir(sglob->slurpd_rdir, 0755) == -1 && errno != EEXIST) {
+       perror(sglob->slurpd_rdir);
+       exit( 1 );
+    }
+
     /*
      * Get any saved state information off the disk.
      */