mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +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:
@@ -137,7 +137,7 @@ libzfs_core_init(void)
|
||||
{
|
||||
(void) pthread_mutex_lock(&g_lock);
|
||||
if (g_refcount == 0) {
|
||||
g_fd = open(ZFS_DEV, O_RDWR);
|
||||
g_fd = open(ZFS_DEV, O_RDWR|O_CLOEXEC);
|
||||
if (g_fd < 0) {
|
||||
(void) pthread_mutex_unlock(&g_lock);
|
||||
return (errno);
|
||||
|
||||
Reference in New Issue
Block a user