krb5: Always try mkdir in DIR: ccache (quiet [harmless] TOCTOU warning)
This commit is contained in:
@@ -273,19 +273,18 @@ verify_directory(krb5_context context, const char *path)
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
/* XXX should use mkdirx_np() */
|
||||
if (rk_mkdir(path, S_IRWXU) == 0)
|
||||
return 0;
|
||||
|
||||
if (stat(path, &sb) != 0) {
|
||||
if (errno == ENOENT) {
|
||||
/* XXX should use mkdirx_np() */
|
||||
if (rk_mkdir(path, S_IRWXU) == 0)
|
||||
return 0;
|
||||
|
||||
krb5_set_error_message(context, ENOENT,
|
||||
N_("DIR directory %s doesn't exists", ""), path);
|
||||
return ENOENT;
|
||||
} else {
|
||||
int ret = errno;
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("DIR directory %s is bad: %s", ""), path, strerror(ret));
|
||||
krb5_set_error_message(context, errno,
|
||||
N_("DIR directory %s is bad: %s", ""), path, strerror(errno));
|
||||
return errno;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user