]> andersk Git - moira.git/blobdiff - server/mr_main.c
Command line printer manipulation client, and build goo.
[moira.git] / server / mr_main.c
index 1b90b849c797cd982117ec4ef26969295fb5085c..eb05ff219de9fb157bb962373112314a91199f86 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
+#ifdef HAVE_KRB4
 #include <krb.h>
+#endif
+#include <krb5.h>
 
 RCSID("$Header$");
 
@@ -41,7 +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;
@@ -104,7 +108,19 @@ int main(int argc, char **argv)
        }
     }
 
-  krb_get_lrealm(krb_realm, 1);
+  status = krb5_init_context(&context);
+  if (status)
+    {
+      com_err(whoami, status, "Initializing krb5 context.");
+      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.
@@ -217,7 +233,7 @@ int main(int argc, char **argv)
 
       if (child_exited_abnormally)
        {
-         critical_alert("moirad", "%d: child exits with signal %d status %d",
+         critical_alert(whoami, "moirad", "%d: child exits with signal %d status %d",
                         child_pid, child_signal, child_status);
          child_exited_abnormally = 0;
        }
This page took 0.035136 seconds and 4 git commands to generate.