maint: use more *-safer gnulib modules

See section "Handling closed standard file descriptors" in the gnulib
manual.

* bootstrip.conf (gnulib_modules): Add fcntl-safer, openat-safer
and unistd-safer.
* find/exec.c: Include "fcntl--.h" to use the *-safer variant of open()
or openat().
* find/pred.c: Likewise.
* locate/locate.c: Likewise.
* xargs/xargs.c: Likewise, and include "unustd--.h" to use the *-safer
variant of pipe().
This commit is contained in:
Bernhard Voelker 2020-12-02 01:12:16 +01:00
parent f65445d23c
commit 160e2f8258
5 changed files with 8 additions and 0 deletions

View File

@ -93,6 +93,7 @@ gnulib_modules="
faccessat
fchdir
fcntl
fcntl-safer
fdopendir
fflush
fileblocks
@ -131,6 +132,7 @@ gnulib_modules="
mountlist
nstrftime
open
openat-safer
parse-datetime
pathmax
perror
@ -167,6 +169,7 @@ gnulib_modules="
sys_wait
timespec
uname
unistd-safer
unlinkat
verify
version-etc

View File

@ -30,6 +30,7 @@
#include "cloexec.h"
#include "dirname.h"
#include "error.h"
#include "fcntl--.h"
#include "save-cwd.h"
#include "xalloc.h"

View File

@ -38,6 +38,7 @@
#include "areadlink.h"
#include "dirname.h"
#include "error.h"
#include "fcntl--.h"
#include "fnmatch.h"
#include "stat-size.h"
#include "stat-time.h"

View File

@ -84,6 +84,7 @@
#include "progname.h"
#include "xalloc.h"
#include "error.h"
#include "fcntl--.h"
#include "human.h"
#include "dirname.h"
#include "closeout.h"

View File

@ -54,9 +54,11 @@
/* gnulib headers. */
#include "closein.h"
#include "error.h"
#include "fcntl--.h"
#include "progname.h"
#include "quotearg.h"
#include "safe-read.h"
#include "unistd--.h"
#include "xalloc.h"
/* find headers. */