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);
duser = 'DIR::%s/tkt1' % ccdir
dalice = 'DIR::%s/tkt2' % ccdir
dbob = 'DIR::%s/tkt3' % ccdir
-os.mkdir(ccdir)
realm.kinit('user', password('user'), flags=['-c', duser])
realm.kinit('alice', password('alice'), flags=['-c', dalice])
realm.kinit('bob', password('bob'), flags=['-c', dbob])
# Make a directory collection and use it for client commands in both realms.
ccdir = os.path.join(r1.testdir, 'cc')
ccname = 'DIR:' + ccdir
-os.mkdir(ccdir)
r1.env_client['KRB5CCNAME'] = ccname
r2.env_client['KRB5CCNAME'] = ccname
# Make a directory collection and use it for client commands in both realms.
ccdir = os.path.join(realm.testdir, 'cc')
ccname = 'DIR:' + ccdir
-os.mkdir(ccdir)
realm.env_client['KRB5CCNAME'] = ccname
realm.addprinc('alice', password('alice'))