mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zkey: Fix listing of keys on file systems reporting DT_UNKNOWN
The zkey list function uses scandir() to look for files in the zkey key repository directory. It checks the dirent.d_type field to consider only regular files, but skip all others. Unfortunately, not all file systems have full support for returning the file type in d_type. When the zkey repository is located in a file system that does not support d_type, such as xfs, zkey list shows no keys, although the key repository contains keys. Fix this by also considering directory entries with d_type = DT_UNKNOWN. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
27a6409a4a
commit
0de533aef9
@@ -906,7 +906,7 @@ static int _keystore_info_file_filter(const struct dirent *dirent)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
if (dirent->d_type != DT_REG)
|
||||
if (dirent->d_type != DT_REG && dirent->d_type != DT_UNKNOWN)
|
||||
return 0;
|
||||
|
||||
len = strlen(dirent->d_name);
|
||||
|
||||
Reference in New Issue
Block a user