From: Duncan Overbruck Date: Tue, 5 Mar 2024 16:01:29 +0000 (+0100) Subject: closefrom: Ignore files starting with dot when scanning /proc/self/fd X-Git-Tag: 0.12.2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee63bca5258374c93ee2b34459f4ad0c08958daf;p=thirdparty%2Flibbsd.git closefrom: Ignore files starting with dot when scanning /proc/self/fd Signed-off-by: Guillem Jover --- diff --git a/src/closefrom.c b/src/closefrom.c index 2df5d03..41c9668 100644 --- a/src/closefrom.c +++ b/src/closefrom.c @@ -153,6 +153,9 @@ closefrom_procfs(int lowfd) const char *errstr; int fd; + if (dent->d_name[0] == '.') + continue; + fd = strtonum(dent->d_name, lowfd, INT_MAX, &errstr); if (errstr != NULL || fd == dirfd(dirp)) continue;