]> andersk Git - moira.git/blobdiff - update/update_test.c
don't flame about being unable to delete filesystem if the `propagate
[moira.git] / update / update_test.c
index 978dafb1452196aed2286b9736ad84f0eb35fd1f..3cbf1499f3437673342cd71c9a41f09e7f87afd0 100644 (file)
@@ -5,6 +5,7 @@
  * Reads commands from the command line:
  * test host [commands...]
  *     -s file file    sends file to host
+ *     -S file file    sends encrypted file to host
  *     -i file         sends instruction file to host
  *     -x file         executes instructions
  *     -n              nop
@@ -12,7 +13,7 @@
 
 #include <mit-copyright.h>
 #include <stdio.h>
-#include <strings.h>
+#include <string.h>
 #include <gdb.h>
 #include <sys/param.h>
 #include <sys/wait.h>
@@ -27,7 +28,6 @@
 CONNECTION conn;
 char *whoami;
 
-
 main(argc, argv)
 int argc;
 char **argv;
@@ -63,7 +63,14 @@ char **argv;
            file = argv[++i];
            rfile = argv[++i];
            fprintf(stderr, "Sending file %s to %s as %s\n", file, host, rfile);
-           send_file(file, rfile);
+           send_file(file, rfile, 0);
+           break;
+       case 'S':
+           if (i+2 >= argc) usage();
+           file = argv[++i];
+           rfile = argv[++i];
+           fprintf(stderr, "Sending (encrypted) file %s to %s as %s\n", file, host, rfile);
+           send_file(file, rfile, 1);
            break;
        case 'i':
            if (i+1 >= argc) usage();
@@ -72,7 +79,7 @@ char **argv;
            mktemp(buf);
            fprintf(stderr, "Sending instructions %s to %s as %s\n",
                    file, host, buf);
-           send_file(file, buf);
+           send_file(file, buf, 0);
            break;
        case 'I':
            if (i+2 >= argc) usage();
@@ -81,7 +88,7 @@ char **argv;
            strcpy(buf, rfile);
            fprintf(stderr, "Sending instructions %s to %s as %s\n",
                    file, host, buf);
-           send_file(file, buf);
+           send_file(file, buf, 0);
            break;
        case 'x':
            fprintf(stderr, "Executing instructions %s on %s\n", buf, host);
@@ -111,6 +118,7 @@ usage()
     fprintf(stderr, "Usage: test host [commands...]\n");
     fprintf(stderr, "  Commands are:\n");
     fprintf(stderr, "\t-s srcfile dstfile\tsends file\n");
+    fprintf(stderr, "\t-S srcfile dstfile\tsends encrypted file\n");
     fprintf(stderr, "\t-i srcfile\t\tsends instructions\n");
     fprintf(stderr, "\t-I srcfile dstfile\tsends instructions\n");
     fprintf(stderr, "\t-x\t\texecutes last instructions\n");
@@ -118,7 +126,6 @@ usage()
     exit(1);
 }
 
-static
 send_auth(host_name)
 char *host_name;
 {
@@ -162,7 +169,6 @@ char *host_name;
     return(MR_SUCCESS);
 }
 
-static
 execute(path)
     char *path;
 {
This page took 0.040832 seconds and 4 git commands to generate.