]> andersk Git - moira.git/blobdiff - update/ticket.c
don't flame about being unable to delete filesystem if the `propagate
[moira.git] / update / ticket.c
index 59f3a8e812abb0b2beaa6b1bbfbcfff79f884745..6e5f6d1d50cb0bcde880153b9121e59615f26727 100644 (file)
@@ -8,18 +8,20 @@
 
 #ifndef lint
 static char *rcsid_ticket_c = "$Header$";
-#endif lint
+#endif
 
 #include <mit-copyright.h>
 #include <stdio.h>
 #include <krb.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <strings.h>
+#include <string.h>
 #include <update.h>
 #include <com_err.h>
 #include <krb_et.h>
 
+extern char *whoami;
+
 /* too bad we can't set the pathname easily */
 static char *srvtab = KEYFILE; /* default == /etc/srvtab */
 static char realm[REALM_SZ];
@@ -53,27 +55,24 @@ get_mr_update_ticket(host, ticket)
 
      pass = 1;
      init();
-     strcpy(phost, krb_get_phost(host));
+     strcpy(phost, (char*)krb_get_phost(host));
  try_it:
      code = krb_mk_req(ticket, service, phost, realm, (long)0);
      if (code) {
-        code += ERROR_TABLE_BASE_krb;
+        if (pass == 1) {
+            /* maybe we're taking too long? */
+            if ((code = get_mr_tgt()) != 0) {
+                com_err(whoami, code, " can't get Kerberos TGT");
+                return(code);
+            }
+            pass++;
+            goto try_it;
+        }
         com_err(whoami, code, "in krb_mk_req");
      } else {
         code = krb_get_cred(service, phost, realm, &cr);
-        bcopy(cr.session, session, sizeof(session));
-     }
-#ifdef notdef
-     if (pass == 1) {
-        /* maybe we're taking too long? */
-        if ((code = get_mr_tgt()) != 0) {
-            com_err(whoami, code, " can't get Kerberos TGT");
-            return(code);
-        }
-        pass++;
-        goto try_it;
+        memcpy(session, cr.session, sizeof(session));
      }
-#endif /* notdef */
      return(code);
 }
 
@@ -86,7 +85,8 @@ get_mr_tgt()
     init();
     linst[0] = '\0';
     strcpy(kinst, "krbtgt");
-    code = krb_get_svc_in_tkt(master, linst, realm, kinst, realm, 1, srvtab);
+    code = krb_get_svc_in_tkt(master, linst, realm, kinst, realm,
+                             DEFAULT_TKT_LIFE, srvtab);
     if (!code)
        return(0);
     else
This page took 0.034737 seconds and 4 git commands to generate.