util/nvmutil: check whether a file is a file

and not, say, a socket or a directory, or
a character device, or something else.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-10 10:35:51 +00:00
parent 91a6395e5c
commit cbd7ad13a3
+3
View File
@@ -745,6 +745,9 @@ xopen(int *fd_ptr, const char *path, int flags, struct stat *st)
if (fstat(*fd_ptr, st) == -1)
err(ECANCELED, "%s", path);
if (!S_ISREG(st->st_mode))
err(ECANCELED, "%s: not a regular file", path);
}
static void