]> andersk Git - moira.git/blobdiff - lib/mr_auth.c
Build without krb4 if it's unavailable.
[moira.git] / lib / mr_auth.c
index 9c7641bb4405f4fa100efd84374820e5ee26223c..4e1d6b0ab9803476934264ce975a1470533c153c 100644 (file)
@@ -15,7 +15,9 @@
 #include <stdio.h>
 #include <string.h>
 
+#ifdef HAVE_KRB4
 #include <krb.h>
+#endif
 #include <krb5.h>
 
 krb5_context context = NULL;
@@ -29,6 +31,7 @@ RCSID("$Header$");
 
 int mr_auth(char *prog)
 {
+#ifdef HAVE_KRB4
   int status;
   mr_params params, reply;
   char *args[2];
@@ -70,6 +73,9 @@ int mr_auth(char *prog)
   mr_destroy_reply(reply);
 
   return status;
+#else
+  return MR_NO_KRB4;
+#endif
 }
 
 int mr_proxy(char *principal, char *orig_authtype)
@@ -78,6 +84,8 @@ int mr_proxy(char *principal, char *orig_authtype)
   mr_params params, reply;
   char *args[2];
 
+  CHECK_CONNECTED;
+
   params.u.mr_procno = MR_PROXY;
   params.mr_argc = 2;
   params.mr_argv = args;
@@ -110,13 +118,6 @@ int mr_krb5_auth(char *prog)
   if ((problem = mr_host(host, sizeof(host) - 1)))
     return problem;
 
-  for (p = host; *p && *p != '.'; p++)
-    {
-      if (isupper(*p))
-       *p = tolower(*p);
-    }
-  *p = '\0';
-
   if (!context)
     {
       problem = krb5_init_context(&context);
@@ -132,7 +133,7 @@ int mr_krb5_auth(char *prog)
   if (problem)
     goto out;
 
-  problem = krb5_mk_req(context, &auth_con, NULL, MOIRA_SNAME, host, NULL, 
+  problem = krb5_mk_req(context, &auth_con, 0, MOIRA_SNAME, host, NULL, 
                       ccache, &auth);
   if (problem)
     goto out;
This page took 0.05439 seconds and 4 git commands to generate.