summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-14 18:27:34 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-26 06:59:41 +0000
commit3c42608d6dba4987b44acbaabfc02e54dbe52fa4 (patch)
tree34cc9ff23e6e9f256bd2d50052ceee678a36bf6a
parent5f6038af5dc932342bae50d6e2b7442928c3e3aa (diff)
util/nvmutil: check if gbe.bin is seekable
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 637f6a45..d291e7b0 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -999,6 +999,9 @@ xopen(int *fd_ptr, const char *path, int flags, struct stat *st)
if (!S_ISREG(st->st_mode))
err(errno, "%s: not a regular file", path);
+
+ if (lseek(*fd_ptr, 0, SEEK_CUR) == (off_t)-1)
+ err(errno, "%s: file not seekable", path);
}
static void