summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/ccache/cc_dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/krb5/ccache/cc_dir.c')
-rw-r--r--src/lib/krb5/ccache/cc_dir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/krb5/ccache/cc_dir.c b/src/lib/krb5/ccache/cc_dir.c
index f241c0acb2..dc133f91ba 100644
--- a/src/lib/krb5/ccache/cc_dir.c
+++ b/src/lib/krb5/ccache/cc_dir.c
@@ -218,13 +218,15 @@ cleanup:
return ret;
}
-/* Verify that a cache directory path exists as a directory. */
+/* Verify or create a cache directory path. */
static krb5_error_code
verify_dir(krb5_context context, const char *dirname)
{
struct stat st;
if (stat(dirname, &st) < 0) {
+ if (errno == ENOENT && mkdir(dirname, S_IRWXU) == 0)
+ return 0;
krb5_set_error_message(context, KRB5_FCC_NOFILE,
_("Credential cache directory %s does not "
"exist"), dirname);