Skip to contentSkip to conversation

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

PATCH Applied Stefan Berger 2 participants 2 messages Jul 16, 2021 Keys-trusted

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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().

---
 src/evmctl.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
src/evmctl.c +2 -6
index 04f14af..4b5a808 100644
@@ -362,9 +362,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
 		st.st_mode = strtoul(mode_str, NULL, 10);
 
 	if (!evm_immutable) {
-		if ((S_ISREG(st.st_mode) || S_ISDIR(st.st_mode)) && !generation_str) {
-			/* we cannot at the momement to get generation of
-			   special files kernel API does not support it */
+		if (S_ISREG(st.st_mode) && !generation_str) {
 			int fd = open(file, 0);
 
 			if (fd < 0) {
@@ -1115,9 +1113,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
 		goto out;
 	}
 
-	if (S_ISREG(st.st_mode) || S_ISDIR(st.st_mode)) {
-		/* we cannot at the momement to get generation of special files..
-		 * kernel API does not support it */
+	if (S_ISREG(st.st_mode)) {
 		int fd = open(file, 0);
 
 		if (fd < 0) {
Signature · 1 line
2.31.1