1
0
mirror of https://git.code.sf.net/p/linux-ima/ima-evm-utils synced 2025-04-28 14:43:37 +02:00

evmctl: Remove left-over check S_ISDIR() for directory signing

Since we are not signing directory entries, remove the left-over check
with S_ISDIR().

Suggested-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
Stefan Berger 2021-07-16 15:33:00 -04:00 committed by Mimi Zohar
parent 6cdbd2d49f
commit 6ecb883528

View File

@ -362,9 +362,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
st.st_mode = strtoul(mode_str, NULL, 10); st.st_mode = strtoul(mode_str, NULL, 10);
if (!evm_immutable) { if (!evm_immutable) {
if ((S_ISREG(st.st_mode) || S_ISDIR(st.st_mode)) && !generation_str) { if (S_ISREG(st.st_mode) && !generation_str) {
/* we cannot at the momement to get generation of
special files kernel API does not support it */
int fd = open(file, 0); int fd = open(file, 0);
if (fd < 0) { if (fd < 0) {
@ -1116,9 +1114,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
goto out; goto out;
} }
if (S_ISREG(st.st_mode) || S_ISDIR(st.st_mode)) { if (S_ISREG(st.st_mode)) {
/* we cannot at the momement to get generation of special files..
* kernel API does not support it */
int fd = open(file, 0); int fd = open(file, 0);
if (fd < 0) { if (fd < 0) {