mirror_zfs/lib/libuutil
наб 2453d0263d lib/: set O_CLOEXEC on all fds
As found by
  git grep -E '(open|setmntent|pipe2?)\(' |
    grep -vE '((zfs|zpool)_|fd|dl|lzc_re|pidfile_|g_)open\('

FreeBSD's pidfile_open() says nothing about the flags of the files it
opens, but we can't do anything about it anyway; the implementation does
open all files with O_CLOEXEC

Consider this output with zpool.d/media appended with
"pid=$$; (ls -l /proc/$pid/fd > /dev/tty)":
  $ /sbin/zpool iostat -vc media
  lrwx------ 0 -> /dev/pts/0
  l-wx------ 1 -> 'pipe:[3278500]'
  l-wx------ 2 -> /dev/null
  lrwx------ 3 -> /dev/zfs
  lr-x------ 4 -> /proc/31895/mounts
  lrwx------ 5 -> /dev/zfs
  lr-x------ 10 -> /usr/lib/zfs-linux/zpool.d/media
vs
  $ ./zpool iostat -vc vendor,upath,iostat,media
  lrwx------ 0 -> /dev/pts/0
  l-wx------ 1 -> 'pipe:[3279887]'
  l-wx------ 2 -> /dev/null
  lr-x------ 10 -> /usr/lib/zfs-linux/zpool.d/media

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11866
2021-04-14 13:23:07 -07:00
..
libuutil.abi Add ABI snapshot 2020-11-17 09:21:39 -08:00
libuutil.suppr Library ABI tracking with abigail 2020-11-17 09:18:52 -08:00
Makefile.am cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
uu_alloc.c Update to onnv_147 2010-08-26 14:24:34 -07:00
uu_avl.c Fix a resource leak in uu_avl_pool_destroy 2021-01-26 19:39:28 -08:00
uu_dprintf.c Update build system and packaging 2018-05-29 16:00:33 -07:00
uu_ident.c Fix gcc ident pragma warnings 2010-08-27 15:34:02 -07:00
uu_list.c Fix gcc ident pragma warnings 2010-08-27 15:34:02 -07:00
uu_misc.c Fixes for issues found with cppcheck tool 2016-07-27 13:31:22 -07:00
uu_open.c lib/: set O_CLOEXEC on all fds 2021-04-14 13:23:07 -07:00
uu_pname.c Fix gcc ident pragma warnings 2010-08-27 15:34:02 -07:00
uu_string.c Remove unused headers from uu_string.c 2019-10-25 13:53:50 -07:00