Hash :
b1f55699
Author :
Date :
2017-08-12T11:20:41
fts: fix cloexec races * lib/fts.c [!_LIBC]: Do not include dirent--.h, unistd--.h, cloexec.h. (opendirat, diropen): Use O_CLOEXEC instead of set_cloexec_flag. (fts_build): Use F_DUPD_CLOEXEC rinstad of set_cloexec_flag. (fd_ring_check): Set cloexec flag on new file descriptors. (fts_build, fd_ring_check): While we’re at it, make sure the resulting file descriptor is not 0, 1, or 2, since that is easy. * modules/fts (Depends-on): Remove cloexec, dirent-safer, dup, fcntl-safer, unistd-safer. Add fcntl.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
Description:
Traverse a file hierarchy.
Files:
lib/fts_.h
lib/fts.c
lib/fts-cycle.c
m4/fts.m4
Depends-on:
closedir
cycle-check
d-ino
d-type
fchdir
fcntl
fcntl-h
fdopendir
flexmember
fstat
hash
i-ring
lstat
memmove
openat-h
openat-safer
opendir
readdir
stdalign
stdbool
stddef
configure.ac:
gl_FUNC_FTS
dnl Use this version of fts unconditionally, since the GNU libc and
dnl NetBSD versions have bugs and/or unnecessary limitations.
AC_LIBOBJ([fts])
Makefile.am:
Include:
"fts_.h"
License:
GPL
Maintainer:
Jim Meyering