mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-16 23:08:49 +02:00
util/nvmutil: dir fsync with O_DIRECTORY
guards against replacement attacks, on systems that support this flag Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -2150,7 +2150,11 @@ fsync_dir(const char *path)
|
|||||||
strcpy(dirbuf, ".");
|
strcpy(dirbuf, ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
dfd = open(dirbuf, O_RDONLY);
|
dfd = open(dirbuf, O_RDONLY
|
||||||
|
#ifdef O_DIRECTORY
|
||||||
|
| O_DIRECTORY
|
||||||
|
#endif
|
||||||
|
);
|
||||||
if (dfd == -1)
|
if (dfd == -1)
|
||||||
goto err_fsync_dir;
|
goto err_fsync_dir;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user