mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user