From ee63bca5258374c93ee2b34459f4ad0c08958daf Mon Sep 17 00:00:00 2001 From: Duncan Overbruck Date: Tue, 5 Mar 2024 17:01:29 +0100 Subject: [PATCH] closefrom: Ignore files starting with dot when scanning /proc/self/fd Signed-off-by: Guillem Jover --- src/closefrom.c | 3 +++ 1 file changed, 3 insertions(+) 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;