mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 08:56:15 +09:00
util-lib: make sure fd_check_fstype() opens files with O_CLOEXEC
Also, O_NOCTTY is a safer bet, let's add that too.
This commit is contained in:
@@ -204,7 +204,7 @@ int fd_check_fstype(int fd, statfs_f_type_t magic_value) {
|
||||
int path_check_fstype(const char *path, statfs_f_type_t magic_value) {
|
||||
_cleanup_close_ int fd = -1;
|
||||
|
||||
fd = open(path, O_RDONLY);
|
||||
fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY);
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user