]> andersk Git - moira.git/blobdiff - server/mr_main.c
Build without krb4 if it's unavailable.
[moira.git] / server / mr_main.c
index 7337f4551f385cd0d728686be164cc9106d1ca4b..2935aa7f9f7610dc85d3550f19ad4a197c825af3 100644 (file)
@@ -28,7 +28,9 @@
 #include <string.h>
 #include <unistd.h>
 
+#ifdef HAVE_KRB4
 #include <krb.h>
+#endif
 #include <krb5.h>
 
 RCSID("$Header$");
@@ -42,8 +44,8 @@ FILE *journal;
 time_t now;
 
 char *host;
-char krb_realm[REALM_SZ];
 krb5_context context = NULL;
+char *krb_realm = NULL;
 
 /* Client array and associated data. This needs to be global for _list_users */
 client **clients;
@@ -106,8 +108,6 @@ int main(int argc, char **argv)
        }
     }
 
-  krb_get_lrealm(krb_realm, 1);
-
   status = krb5_init_context(&context);
   if (status)
     {
@@ -115,6 +115,13 @@ int main(int argc, char **argv)
       exit(1);
     }
 
+  status = krb5_get_default_realm(context, &krb_realm);
+  if (status)
+    {
+      com_err(whoami, status, "Getting default Kerberos realm.");
+      exit(1);
+    }
+
   /*
    * Database initialization.  Only init if database should be open.
    */
This page took 0.035647 seconds and 4 git commands to generate.