diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-13 16:20:30 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 06:59:41 +0000 |
| commit | 8e555f444cba67db672f56794b303179cc0425cf (patch) | |
| tree | b181cb7b57f6f9ce6beae9f348e310128b9cef2e /util/nvmutil | |
| parent | 47936f52e90e3d0723a6ce46b95b2e64b886dc80 (diff) | |
util/nvmutil: check gbe file type before write
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index c6e25ce7..1a3ee366 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1377,6 +1377,9 @@ write_gbe_file(void) if (gbe_st.st_size != gbe_file_size) err(errno, "%s: file size changed before write", fname); + if (!S_ISREG(gbe_st.st_mode)) + err(errno, "%s: file type changed before write", fname); + for (p = 0; p < 2; p++) { partnum = p ^ command[cmd_index].invert; |
