]> andersk Git - moira.git/blobdiff - update/ticket.c
Add #define's for container query argument positions.
[moira.git] / update / ticket.c
index 3b081f8d4cd0da0b07c1f42464fc36045284b7b0..a04a5214ff7a21384af128f74633163d9dc646e6 100644 (file)
@@ -1,59 +1,41 @@
-/*
- *     $Source$
- *     $Header$
+/* $Id$
+ *
+ * Copyright (C) 1988-1998 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
  */
-/*  (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_ticket_c = "$Header$";
-#endif
 
 #include <mit-copyright.h>
-#include <stdio.h>
-#include <krb.h>
-#include <sys/types.h>
+#include <moira.h>
+
 #include <sys/stat.h>
+
+#include <stdio.h>
 #include <string.h>
+
+#include <krb.h>
 #include <update.h>
-#include <com_err.h>
-#include <krb_et.h>
 
-extern char *whoami;
+RCSID("$Header$");
 
-/* too bad we can't set the pathname easily */
-static char *srvtab = KEYFILE; /* default == /etc/srvtab */
 static char realm[REALM_SZ];
 static char master[INST_SZ] = "sms";
 static char service[ANAME_SZ] = "rcmd";
-C_Block session;
-
-
-static init(void)
-{
-  static int initialized = 0;
-
-  if (!initialized)
-    {
-      if (krb_get_lrealm(realm, 1))
-       strcpy(realm, KRB_REALM);
-      initialize_krb_error_table();
-      initialized = 1;
-    }
-}
+des_cblock session;
 
+static int get_mr_tgt(void);
 
 int get_mr_update_ticket(char *host, KTEXT ticket)
 {
-  int code;
-  int pass;
+  int code, pass;
   char phost[BUFSIZ];
   CREDENTIALS cr;
 
   pass = 1;
-  init();
+  if (krb_get_lrealm(realm, 1))
+    strcpy(realm, KRB_REALM);
   strcpy(phost, (char *)krb_get_phost(host));
+
 try_it:
   code = krb_mk_req(ticket, service, phost, realm, (long)0);
   if (code)
@@ -82,16 +64,15 @@ try_it:
   return code;
 }
 
-int get_mr_tgt(void)
+static int get_mr_tgt(void)
 {
   int code;
   char linst[INST_SZ], kinst[INST_SZ];
 
-  init();
   linst[0] = '\0';
   strcpy(kinst, "krbtgt");
   code = krb_get_svc_in_tkt(master, linst, realm, kinst, realm,
-                           DEFAULT_TKT_LIFE, srvtab);
+                           DEFAULT_TKT_LIFE, KEYFILE);
   if (!code)
     return 0;
   else
This page took 0.083146 seconds and 4 git commands to generate.