>From dc1a69f6dc484e9ca72507f15e940ce3d060376e Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Wed, 2 Dec 2020 02:00:01 +0100 Subject: [PATCH 2/2] maint: use gnulib *_safer functions consistently Avoid using fopen_safer and opendir_safer directly in favor of letting gnulib transparently doing the work via "dirent--.h" and "stdio--.h". * find/oldfind.c (dirent-safer.h): Replace include ... (dirent--.h): ... by this. (process_dir): Change opendir_safer to the regular opendir call. * find/sharefile.c (stdio-safer.h): Replace include ... (stdio--.h): ... by this. (sharefile_fopen): Change fopen_safer to regular fopen call. * lib/fdleak.c (dirent-safer.h): Replace include ... (dirent--.h): ... by this. (get_proc_max_fd): Change opendir_safer to regular opendir call. --- find/oldfind.c | 4 ++-- find/sharefile.c | 4 ++-- lib/fdleak.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/find/oldfind.c b/find/oldfind.c index d40bfb52..1da68037 100644 --- a/find/oldfind.c +++ b/find/oldfind.c @@ -35,7 +35,7 @@ /* gnulib headers. */ #include "canonicalize.h" #include "closein.h" -#include "dirent-safer.h" +#include "dirent--.h" #include "dirname.h" #include "error.h" #include "fcntl--.h" @@ -1304,7 +1304,7 @@ process_dir (const char *pathname, const char *name, int pathlen, const struct s } errno = 0; - dirp = opendir_safer (name); + dirp = opendir (name); if (dirp == NULL) { diff --git a/find/sharefile.c b/find/sharefile.c index 2b2bff72..384432ff 100644 --- a/find/sharefile.c +++ b/find/sharefile.c @@ -29,7 +29,7 @@ /* gnulib headers. */ #include "cloexec.h" #include "hash.h" -#include "stdio-safer.h" +#include "stdio--.h" /* find headers. */ #include "sharefile.h" @@ -154,7 +154,7 @@ sharefile_fopen (sharefile_handle h, const char *filename) return NULL; } - if (NULL == (new_entry->fp = fopen_safer (filename, p->mode))) + if (NULL == (new_entry->fp = fopen (filename, p->mode))) { entry_free (new_entry); return NULL; diff --git a/lib/fdleak.c b/lib/fdleak.c index 269c860d..7509b8f5 100644 --- a/lib/fdleak.c +++ b/lib/fdleak.c @@ -34,7 +34,7 @@ /* gnulib headers. */ #include "cloexec.h" -#include "dirent-safer.h" +#include "dirent--.h" #include "error.h" #include "fcntl--.h" @@ -66,7 +66,7 @@ get_proc_max_fd (void) * a given directory (the manpage for readdir_r claims this * is the approved method, but the manpage for pathconf indicates * that _PC_NAME_MAX is not an upper limit). */ - DIR *dir = opendir_safer (path); + DIR *dir = opendir (path); if (dir) { int good = 0; -- 2.29.2