]> andersk Git - moira.git/blobdiff - lib/mr_auth.c
punt mrgdb
[moira.git] / lib / mr_auth.c
index aabd780de7b47fd090ca460fc44b28748165e845..c70cced5edda59bf4d401c586e7916244c42211e 100644 (file)
@@ -12,6 +12,7 @@
 #include "mr_private.h"
 
 #include <ctype.h>
+#include <stdio.h>
 #include <string.h>
 
 #include <krb.h>
@@ -25,19 +26,14 @@ RCSID("$Header$");
 int mr_auth(char *prog)
 {
   int status;
-  mr_params params_st;
+  mr_params params, reply;
   char *args[2];
   int argl[2];
   char realm[REALM_SZ], host[BUFSIZ], *p;
-  mr_params *params = &params_st;
-  mr_params *reply = NULL;
   KTEXT_ST auth;
 
   CHECK_CONNECTED;
 
-  /* Build a Kerberos authenticator. */
-
-  memset(host, 0, sizeof(host));
   if ((status = mr_host(host, sizeof(host) - 1)))
     return status;
 
@@ -55,21 +51,17 @@ int mr_auth(char *prog)
       status += ERROR_TABLE_BASE_krb;
       return status;
     }
-  params->mr_version_no = sending_version_no;
-  params->mr_procno = MR_AUTH;
-  params->mr_argc = 2;
-  params->mr_argv = args;
-  params->mr_argl = argl;
-  params->mr_argv[0] = (char *)auth.dat;
-  params->mr_argl[0] = auth.length;
-  params->mr_argv[1] = prog;
-  params->mr_argl[1] = strlen(prog) + 1;
-
-  if (sending_version_no == MR_VERSION_1)
-    params->mr_argc = 1;
+  params.u.mr_procno = MR_AUTH;
+  params.mr_argc = 2;
+  params.mr_argv = args;
+  params.mr_argl = argl;
+  params.mr_argv[0] = (char *)auth.dat;
+  params.mr_argl[0] = auth.length;
+  params.mr_argv[1] = prog;
+  params.mr_argl[1] = strlen(prog) + 1;
 
-  if ((status = mr_do_call(params, &reply)) == 0)
-    status = reply->mr_status;
+  if ((status = mr_do_call(&params, &reply)) == MR_SUCCESS)
+    status = reply.u.mr_status;
 
   mr_destroy_reply(reply);
 
This page took 0.268372 seconds and 4 git commands to generate.