]> andersk Git - moira.git/commitdiff
remove references to dcm.h
authordanw <danw>
Fri, 5 Sep 1997 20:16:09 +0000 (20:16 +0000)
committerdanw <danw>
Fri, 5 Sep 1997 20:16:09 +0000 (20:16 +0000)
mr_update_server in client.c is no longer used by either update_test or dcm
fix an error message typo in ticket.c

update/client.c
update/send_file.c
update/ticket.c
update/update_test.c

index 0ab206442a2a9361e0e7a158f16022a0733f6e7e..1d88e0c116fe485d1c72c7936462858d9f2c9ad2 100644 (file)
@@ -34,7 +34,6 @@ static char *rcsid_client2_c = "$Header$";
 #include <sys/socket.h>
 #include <update.h>
 #include <errno.h>
-#include <dcm.h>
 #include <moira.h>
 #include <moira_site.h>
 #include <krb.h>
@@ -74,125 +73,6 @@ initialize()
     }
 }
 
-
-/*
- * FUNCTION:
- *     mr_update_server(service, machine, target_path)
- * DESCRIPTION:
- *     Attempts to perform an update to the named machine
- *     of the named service.  The file DCM_DIR/service.out
- *     will be sent, then the file SMS_DIR/bin/service.sh,
- *     the the shell script will be executed.
- * INPUT:
- *     service
- *             Name of service to be updated; used to find
- *             the source data file in the MR data directory.
- *     machine
- *     target_path
- *             Location to install the file.
- * RETURN VALUE:
- *     int:
- *             Error code, or zero if no error was detected
- *             in the data supplied to this routine.
- * SIDE EFFECTS:
- *     May write information to logs.
- * PROBLEMS:
- *
- */
-
-int
-mr_update_server(service, machine, target_path, instructions)
-char *service;
-char *machine;
-char *target_path;
-char *instructions;
-{
-#define ASSERT(condition,stat,amsg) \
-    if (!(condition)) { com_err(whoami, stat, amsg); return(stat); }
-#define ASSERT2(condition,stat,amsg,arg1) \
-    if (!(condition)) { com_err(whoami, stat, amsg, arg1); return(stat); }
-#define NONNULL(str) \
-    (((str) != (char *)NULL) && (strlen(str) != 0))
-
-    char *service_address, *service_updated, *pathname;
-    int on;
-    
-    /* some sanity checking of arguments while we build data */
-    ASSERT(NONNULL(machine), MR_INTERNAL, " null host name");
-    ASSERT(NONNULL(service), MR_INTERNAL, " null service name");
-    ASSERT((strlen(machine) + strlen(service) + 2 < BUFSIZ), MR_ARG_TOO_LONG,
-          " machine and service names");
-    sprintf(buf, "%s:%s", machine, service);
-    service_updated = strsave(buf);
-    ASSERT(NONNULL(service_updated), MR_NO_MEM, " for service name");
-    ASSERT((strlen(machine)+strlen(SERVICE_NAME)+2 < BUFSIZ), MR_ARG_TOO_LONG,
-          " machine and update service name");
-    sprintf(buf, "%s:%s", machine, SERVICE_NAME);
-    service_address = strsave(buf);
-    ASSERT(NONNULL(service_address), MR_NO_MEM, " for service address");
-    ASSERT(NONNULL(target_path), MR_INTERNAL, " null target pathname");
-    ASSERT((strlen(target_path) < MAXPATHLEN), MR_ARG_TOO_LONG,
-          " target pathname");
-    ASSERT2(target_path[0] == '/', MR_NOT_UNIQUE,
-          " non-absolute pathname supplied \"%s\"", target_path);
-    sprintf(buf, "%s/%s.out", DCM_DIR, service);
-    pathname = strsave(buf);
-    ASSERT(NONNULL(pathname), MR_NO_MEM, " for pathname");
-    ASSERT(NONNULL(instructions), MR_NO_MEM, " for instructions");
-    ASSERT((strlen(instructions) < MAXPATHLEN), MR_ARG_TOO_LONG,
-          " instruction pathname");
-    
-    initialize();
-    com_err(whoami, 0, "starting update for %s", service_updated);
-    
-    /* open connection */
-    gdb_Options |= GDB_OPT_KEEPALIVE;
-    conn = start_server_connection(service_address, "");
-    if (!conn || (connection_status(conn) == CON_STOPPED)) {
-       com_err(whoami, connection_errno(conn),
-               " can't connect to update %s", service_address);
-       return(MR_CANT_CONNECT);
-    }
-    
-    /* send authenticators */
-    code = send_auth(machine);
-    if (code) {
-       com_err(whoami, code, " authorization attempt to %s failed",
-               service_updated);
-       goto update_failed;
-    }
-    
-    code = send_file(pathname, target_path, 1);
-    if (code)
-      goto update_failed;
-
-    /* send instructions for installation */
-    strcpy(buf, "/tmp/moira-update.XXXXXX");
-    mktemp(buf);
-    code = send_file(instructions, buf, 0);
-    if (code)
-      goto update_failed;
-
-    /* perform installation */
-    code = execute(buf);
-    if (code) {
-       com_err(whoami, code, " installation of %s failed, code = %d",
-               service_updated, code);
-       goto update_failed;
-    }
-    
-    /* finished updates */
-    code = MR_SUCCESS;
-
- update_failed:
-    send_quit();
-    conn = sever_connection(conn);
-    return(code);
-
-#undef NONNULL
-#undef ASSERT
-}
-
 send_auth(host_name)
 char *host_name;
 {
index dc2699915109c94fdea57c84da476031525337aa..5577391354dc38127053472e51a5a8d61ac27a4d 100644 (file)
@@ -14,7 +14,6 @@ static char *rcsid_send_file_c = "$Header$";
 #include <stdio.h>
 #include <com_err.h>
 #include <gdb.h>
-#include <dcm.h>
 #include <moira.h>
 #include <sys/file.h>
 #include <sys/stat.h>
@@ -29,6 +28,7 @@ extern CONNECTION conn;
 extern int errno;
 char buf[BUFSIZ];
 extern C_Block session;
+extern char *whoami;
 
 /*
  * syntax:
index 29b909e6bb49d17695dbacb191676a11557a07ba..1ce5e795b60b74f0b97ea96588c9987f59cbc396 100644 (file)
@@ -62,7 +62,7 @@ get_mr_update_ticket(host, ticket)
         if (pass == 1) {
             /* maybe we're taking too long? */
             if ((code = get_mr_tgt()) != 0) {
-                com_err(whoami, code, " can't get Kerberos TGT");
+                com_err(whoami, code, "can't get Kerberos TGT");
                 return(code);
             }
             pass++;
index ad99e73318ec4797f5d6fc390c01305c2003645d..8e15a324b09e1c377c01e6529049f9d24d07e1a7 100644 (file)
@@ -20,7 +20,6 @@
 #include <sys/socket.h>
 #include <update.h>
 #include <errno.h>
-#include <dcm.h>
 #include <moira.h>
 #include <moira_site.h>
 #include <krb.h>
This page took 0.052243 seconds and 5 git commands to generate.