]> andersk Git - moira.git/blobdiff - update/auth_003.c
Build without krb4 if it's unavailable.
[moira.git] / update / auth_003.c
index acea5d6908271d4704141cb6a97fc7513db34aaf..101be11bcb4d805db3edfc0e81f6b93126b467fc 100644 (file)
 #include <stdio.h>
 #include <string.h>
 
+#ifdef HAVE_KRB4
 #include <krb.h>
+#else
+#include <mr_krb.h>
+#endif
 #include <krb5.h>
 
 RCSID("$Header$");
@@ -44,6 +48,7 @@ void auth_003(int conn, char *str)
   char *p, *first, *data;
   char name[ANAME_SZ], inst[INST_SZ], realm[REALM_SZ];
   char aname[ANAME_SZ], ainst[INST_SZ], arealm[REALM_SZ];
+  char *lrealm = NULL;
   size_t size;
   long code;
   struct utsname uts;
@@ -143,7 +148,11 @@ void auth_003(int conn, char *str)
     {
       strcpy(aname, master);
       strcpy(ainst, "");
-      if (krb_get_lrealm(arealm, 1))
+      if (!krb5_get_default_realm(context, &lrealm))
+        {
+          strcpy(arealm, lrealm);
+        }
+      else
        strcpy(arealm, KRB_REALM);
     }
   code = EPERM;
@@ -159,6 +168,8 @@ void auth_003(int conn, char *str)
   have_authorization = 1;
 
  out:
+  if (lrealm)
+    free(lrealm);
   if (client)
     krb5_free_principal(context, client);
   if (server)
This page took 0.037259 seconds and 4 git commands to generate.