]> andersk Git - moira.git/blobdiff - update/xfer_002.c
new queries to support hosttable in moira
[moira.git] / update / xfer_002.c
index 53120d61accd4750c010b03d23d9dc7cf6575480..411e4b4d907ae45ad72bb836d00723914fc6a277 100644 (file)
@@ -2,19 +2,22 @@
  *     $Source$
  *     $Header$
  */
+/*  (c) Copyright 1988 by the Massachusetts Institute of Technology. */
+/*  For copying and distribution information, please see the file */
+/*  <mit-copyright.h>. */
 
 #ifndef lint
 static char *rcsid_xfer_002_c = "$Header$";
 #endif lint
 
+#include <mit-copyright.h>
 #include <stdio.h>
 #include <gdb.h>
 #include <ctype.h>
 #include <sys/param.h>
 #include <sys/file.h>
 #include <strings.h>
-#include <sms.h>
-#include "kludge.h"
+#include <moira.h>
 
 extern CONNECTION conn;
 char buf[BUFSIZ];
@@ -38,7 +41,7 @@ extern int have_authorization, have_file, done;
  *
  * function:
  *     perform initial preparations and receive file as
- * a single string, storing it into <pathname>.sms_update.
+ * a single string, storing it into <pathname>.moira_update.
  *
  * still to be done: file locking; perform transfers in pieces instead
  * of all at once; use checksums
@@ -57,8 +60,8 @@ xfer_002(str)
        str++;
     if (!*str) {
     failure:
-       reject_call(SMS_ARGS);
-       return;
+       reject_call(MR_ARGS);
+       return(0);
     }
     file_size = atoi(str);
     while (isdigit(*str))
@@ -74,21 +77,21 @@ xfer_002(str)
        goto failure;
     pathname = str;
     if (!have_authorization) {
-       reject_call(SMS_PERM);
-       return;
+       reject_call(MR_PERM);
+       return(0);
     }
     if (done)                  /* re-initialize data */
        initialize();
     code = send_ok();
     if (code)
        lose("sending ok for file xfer (2)");
-    code = get_file(pathname, file_size, checksum);
+    code = get_file(pathname, file_size, checksum, 0700, 0);
     if (!code) {
        char buf[BUFSIZ];
        have_file = 1;
        strcpy(buf, "transferred file ");
        strcat(buf, pathname);
-       sms_log_info(buf);
+       mr_log_info(buf);
     }
-    return;
+    return(0);
 }
This page took 0.514317 seconds and 4 git commands to generate.