mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-27 04:32:16 +03:00
libzfs{,_core}: set O_CLOEXEC on persistent (ZFS_DEV and MNTTAB) fds
These were fd 3, 4, and 5 by the time zfs change-key hit execute_key_fob() glibc appends "e" to setmntent() mode, but musl's just returns fopen() Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #11866
This commit is contained in:
@@ -1517,7 +1517,7 @@ zpool_disable_datasets(zpool_handle_t *zhp, boolean_t force)
|
||||
namelen = strlen(zhp->zpool_name);
|
||||
|
||||
/* Reopen MNTTAB to prevent reading stale data from open file */
|
||||
if (freopen(MNTTAB, "r", hdl->libzfs_mnttab) == NULL)
|
||||
if (freopen(MNTTAB, "re", hdl->libzfs_mnttab) == NULL)
|
||||
return (ENOENT);
|
||||
|
||||
used = alloc = 0;
|
||||
|
||||
Reference in New Issue
Block a user