Imported Upstream version 2.5.1p3
[debian/amanda] / server-src / driverio.c
index acf850edbe840030afbdffe16d07a53b822f3e58..04ed8527b451044c38e936f35f0f647e00697e09 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: driverio.c,v 1.92 2006/08/24 01:57:16 paddy_s Exp $
+ * $Id: driverio.c,v 1.92.2.2 2006/12/12 14:56:39 martinea Exp $
  *
  * I/O-related functions for driver program
  */
@@ -84,7 +84,8 @@ void
 startup_tape_process(
     char *taper_program)
 {
-    int fd[2];
+    int    fd[2];
+    char **config_options;
 
     if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd) == -1) {
        error("taper pipe: %s", strerror(errno));
@@ -110,7 +111,10 @@ startup_tape_process(
        aclose(fd[0]);
        if(dup2(fd[1], 0) == -1 || dup2(fd[1], 1) == -1)
            error("taper dup2: %s", strerror(errno));
-       execle(taper_program, "taper", config_name, (char *)0, safe_env());
+       config_options = get_config_options(2);
+       config_options[0] = "taper";
+       config_options[1] = config_name;
+       execve(taper_program, config_options, safe_env());
        error("exec %s: %s", taper_program, strerror(errno));
        /*NOTREACHED*/
 
@@ -126,7 +130,8 @@ startup_dump_process(
     dumper_t *dumper,
     char *dumper_program)
 {
-    int fd[2];
+    int    fd[2];
+    char **config_options;
 
     if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd) == -1) {
        error("%s pipe: %s", dumper->name, strerror(errno));
@@ -142,11 +147,10 @@ startup_dump_process(
        aclose(fd[0]);
        if(dup2(fd[1], 0) == -1 || dup2(fd[1], 1) == -1)
            error("%s dup2: %s", dumper->name, strerror(errno));
-       execle(dumper_program,
-              dumper->name ? dumper->name : "dumper",
-              config_name,
-              (char *)0,
-              safe_env());
+       config_options = get_config_options(2);
+       config_options[0] = dumper->name ? dumper->name : "dumper",
+       config_options[1] = config_name;
+       execve(dumper_program, config_options, safe_env());
        error("exec %s (%s): %s", dumper_program,
              dumper->name, strerror(errno));
         /*NOTREACHED*/
@@ -191,7 +195,8 @@ startup_chunk_process(
     chunker_t *chunker,
     char *chunker_program)
 {
-    int fd[2];
+    int    fd[2];
+    char **config_options;
 
     if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd) == -1) {
        error("%s pipe: %s", chunker->name, strerror(errno));
@@ -209,11 +214,10 @@ startup_chunk_process(
            error("%s dup2: %s", chunker->name, strerror(errno));
            /*NOTREACHED*/
        }
-       execle(chunker_program,
-              chunker->name ? chunker->name : "chunker",
-              config_name,
-              (char *)0,
-              safe_env());
+       config_options = get_config_options(2);
+       config_options[0] = chunker->name ? chunker->name : "chunker",
+       config_options[1] = config_name;
+       execve(chunker_program, config_options, safe_env());
        error("exec %s (%s): %s", chunker_program,
              chunker->name, strerror(errno));
         /*NOTREACHED*/
@@ -546,7 +550,7 @@ chunker_cmd(
            amfree(qdest);
            amfree(qname);
        } else {
-               error("Write command without disk and holding disk.\n",
+               error("%s command without disk and holding disk.\n",
                      cmdstr[cmd]);
                /*NOTREACHED*/
        }