]> andersk Git - moira.git/commitdiff
Only check the return value of krb5_init_context if we actually called
authorzacheiss <zacheiss>
Mon, 19 Aug 2002 18:23:50 +0000 (18:23 +0000)
committerzacheiss <zacheiss>
Mon, 19 Aug 2002 18:23:50 +0000 (18:23 +0000)
it.  Use krb5_error_code everywhere for sanity reasons.

lib/mr_auth.c

index fccf5f5167a8fa5b6e9647a81aea45ec9eed8d87..9c7641bb4405f4fa100efd84374820e5ee26223c 100644 (file)
@@ -95,21 +95,20 @@ int mr_proxy(char *principal, char *orig_authtype)
 
 int mr_krb5_auth(char *prog)
 {
-  int status;
   mr_params params, reply;
   char host[BUFSIZ], *p;
   char *args[2];
   int argl[2];
   krb5_ccache ccache = NULL;
   krb5_data auth;
-  krb5_error_code problem;
+  krb5_error_code problem = 0;
 
   CHECK_CONNECTED;
 
   memset(&auth, 0, sizeof(auth));
 
-  if ((status = mr_host(host, sizeof(host) - 1)))
-    return status;
+  if ((problem = mr_host(host, sizeof(host) - 1)))
+    return problem;
 
   for (p = host; *p && *p != '.'; p++)
     {
@@ -119,9 +118,11 @@ int mr_krb5_auth(char *prog)
   *p = '\0';
 
   if (!context)
-    problem = krb5_init_context(&context);
-  if (problem)
-    goto out;
+    {
+      problem = krb5_init_context(&context);
+      if (problem)
+       goto out;
+    }
 
   problem = krb5_auth_con_init(context, &auth_con);
   if (problem)
@@ -145,8 +146,8 @@ int mr_krb5_auth(char *prog)
   params.mr_argv[1] = prog;
   params.mr_argl[1] = strlen(prog) + 1;
 
-  if ((status = mr_do_call(&params, &reply)) == MR_SUCCESS)
-    status = reply.u.mr_status;
+  if ((problem = mr_do_call(&params, &reply)) == MR_SUCCESS)
+    problem = reply.u.mr_status;
 
   mr_destroy_reply(reply);
 
@@ -158,6 +159,6 @@ int mr_krb5_auth(char *prog)
     krb5_auth_con_free(context, auth_con);
   auth_con = NULL;
 
-  return status;
+  return problem;
 }
       
This page took 0.079301 seconds and 5 git commands to generate.