From 3e0ec8cd5ecc2975864da2bbf768a3d7dffa829b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 14 Mar 2026 18:27:34 +0000 Subject: util/nvmutil: check if gbe.bin is seekable Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util') 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 -- cgit v1.2.1