zkey: Enhance error message on key store open

Print a meaningful reason when the keystore can not be
accessed, e.g. because the user is not allowed to access
the keystore directory.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2018-10-23 14:34:30 +02:00
committed by Jan Höppner
parent 97fa88299f
commit 9561a0b983

View File

@@ -1359,7 +1359,7 @@ struct keystore *keystore_new(const char *directory, bool verbose)
util_assert(directory != NULL, "Internal error: directory is NULL");
if (stat(directory, &sb) != 0) {
warnx("'%s' does not exist", directory);
warnx("Can not access '%s': %s", directory, strerror(errno));
return NULL;
}
if (!(sb.st_mode & S_IFDIR)) {