mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-17 18:34:57 +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)
|
if (fstat(*fd_ptr, st) == -1)
|
||||||
err(ECANCELED, "%s", path);
|
err(ECANCELED, "%s", path);
|
||||||
|
|
||||||
|
if (!S_ISREG(st->st_mode))
|
||||||
|
err(ECANCELED, "%s: not a regular file", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user