* [PATCH] evmctl: Remove left-over check S_ISDIR() for directory signing
@ 2021-07-16 19:33 Stefan Berger
2021-07-16 21:58 ` Mimi Zohar
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Berger @ 2021-07-16 19:33 UTC (permalink / raw)
To: linux-integrity; +Cc: zohar, Stefan Berger
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>
---
src/evmctl.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/evmctl.c b/src/evmctl.c
index 04f14af..4b5a808 100644
--- a/src/evmctl.c
+++ b/src/evmctl.c
@@ -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) {
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] evmctl: Remove left-over check S_ISDIR() for directory signing
2021-07-16 19:33 [PATCH] evmctl: Remove left-over check S_ISDIR() for directory signing Stefan Berger
@ 2021-07-16 21:58 ` Mimi Zohar
0 siblings, 0 replies; 2+ messages in thread
From: Mimi Zohar @ 2021-07-16 21:58 UTC (permalink / raw)
To: Stefan Berger, linux-integrity
On Fri, 2021-07-16 at 15:33 -0400, Stefan Berger wrote:
> 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>
Thanks, applied to next-integrity.
Mimi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-16 21:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16 19:33 [PATCH] evmctl: Remove left-over check S_ISDIR() for directory signing Stefan Berger
2021-07-16 21:58 ` Mimi Zohar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).