]> andersk Git - moira.git/commitdiff
Use krb5_error_code for return value of krb5 library functions. Reset
authorzacheiss <zacheiss>
Mon, 19 Aug 2002 17:42:45 +0000 (17:42 +0000)
committerzacheiss <zacheiss>
Mon, 19 Aug 2002 17:42:45 +0000 (17:42 +0000)
auth_con to NULL after freeing since it's global.

lib/mr_auth.c

index 6398163c5799617c4632c200bfaf3fc391d485df..fccf5f5167a8fa5b6e9647a81aea45ec9eed8d87 100644 (file)
@@ -102,6 +102,7 @@ int mr_krb5_auth(char *prog)
   int argl[2];
   krb5_ccache ccache = NULL;
   krb5_data auth;
+  krb5_error_code problem;
 
   CHECK_CONNECTED;
 
@@ -118,21 +119,21 @@ int mr_krb5_auth(char *prog)
   *p = '\0';
 
   if (!context)
-    status = krb5_init_context(&context);
-  if (status)
+    problem = krb5_init_context(&context);
+  if (problem)
     goto out;
 
-  status = krb5_auth_con_init(context, &auth_con);
-  if (status)
+  problem = krb5_auth_con_init(context, &auth_con);
+  if (problem)
     goto out;
 
-  status = krb5_cc_default(context, &ccache);
-  if (status)
+  problem = krb5_cc_default(context, &ccache);
+  if (problem)
     goto out;
 
-  status = krb5_mk_req(context, &auth_con, NULL, MOIRA_SNAME, host, NULL, 
+  problem = krb5_mk_req(context, &auth_con, NULL, MOIRA_SNAME, host, NULL, 
                       ccache, &auth);
-  if (status)
+  if (problem)
     goto out;
 
   params.u.mr_procno = MR_KRB5_AUTH;
@@ -155,6 +156,7 @@ int mr_krb5_auth(char *prog)
   krb5_free_data_contents(context, &auth);
   if (auth_con)
     krb5_auth_con_free(context, auth_con);
+  auth_con = NULL;
 
   return status;
 }
This page took 0.703434 seconds and 5 git commands to generate.