* client_init.c (_kadm5_init_any): Use gss_krb5_ccache_name() to
authorTom Yu <tlyu@mit.edu>
Thu, 13 May 1999 21:25:21 +0000 (21:25 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 13 May 1999 21:25:21 +0000 (21:25 +0000)
set the gssapi ccache name.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11439 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kadm5/clnt/ChangeLog
src/lib/kadm5/clnt/client_init.c

index f7033b62f524c7800235fe0097db2358804e11af..9bb42cb26eacb60123689d29478ea117a1e2fc7e 100644 (file)
@@ -1,3 +1,8 @@
+Thu May 13 17:24:44 1999  Tom Yu  <tlyu@mit.edu>
+
+       * client_init.c (_kadm5_init_any): Use gss_krb5_ccache_name() to
+       set the gssapi ccache name.
+
 1998-11-13  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * Makefile.in: Set the myfulldir and mydir variables (which are
index 96c5907af74f2cb2225539c350fd8d2c00f9da30..e86fbe877f34bd60bcd24d4db9635bea894d0485 100644 (file)
@@ -429,11 +429,14 @@ static kadm5_ret_t _kadm5_init_any(char *client_name,
       */
 
      /* use the kadm5 cache */
-     ccname_orig = getenv("KRB5CCNAME");
+     gssstat = gss_krb5_ccache_name(&minor_stat, handle->cache_name,
+                                   &ccname_orig);
+     if (gssstat != GSS_S_COMPLETE) {
+        code = KADM5_GSS_ERROR;
+        goto error;
+     }
      if (ccname_orig)
          ccname_orig = strdup(ccname_orig);
-     
-     (void) krb5_setenv("KRB5CCNAME", handle->cache_name, 1);
 
 #ifndef INIT_TEST
      input_name.value = full_service_name;
@@ -494,11 +497,19 @@ static kadm5_ret_t _kadm5_init_any(char *client_name,
 #endif /* ! INIT_TEST */
 
      if (ccname_orig) {
-         (void) krb5_setenv("KRB5CCNAME", ccname_orig, 1);
-         free(ccname_orig);
-     } else
-         (void) krb5_unsetenv("KRB5CCNAME");
-
+        gssstat = gss_krb5_ccache_name(&minor_stat, ccname_orig, NULL);
+        if (gssstat) {
+            code = KADM5_GSS_ERROR;
+            goto error;
+        }
+        free(ccname_orig);
+     } else {
+        gssstat = gss_krb5_ccache_name(&minor_stat, NULL, NULL);
+        if (gssstat) {
+            code = KADM5_GSS_ERROR;
+            goto error;
+        }
+     }
      
      if (handle->clnt->cl_auth == NULL) {
          code = KADM5_GSS_ERROR;