]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Make krb5_cc_new_unique create DIR: directories
authorNalin Dahyabhai <nalin@redhat.com>
Fri, 8 Aug 2014 20:58:03 +0000 (16:58 -0400)
committerGreg Hudson <ghudson@mit.edu>
Sat, 9 Aug 2014 17:23:08 +0000 (13:23 -0400)
When we use krb5_cc_new_unique to create a new cache in a directory
cache collection, we will fail if the directory doesn't exist yet.

Go ahead and preemptively create it, as we do during krb5_cc_resolve,
before attempting to create a new file under it.

ticket: 7988 (new)
target_version: 1.13
tags: pullup

src/lib/krb5/ccache/cc_dir.c

index d82f33550c3bdaa6f38963f4baf3ccd98a335c20..b00a6bbc413ddfcf27f406a1b6599fb5ed9c4dac 100644 (file)
@@ -401,6 +401,9 @@ dcc_gen_new(krb5_context context, krb5_ccache *cache_out)
                     "is not a directory collection"));
         return KRB5_DCC_CANNOT_CREATE;
     }
+    ret = verify_dir(context, dirname);
+    if (ret)
+        goto cleanup;
     ret = k5_path_join(dirname, "tktXXXXXX", &template);
     if (ret)
         goto cleanup;