closefrom: Ignore files starting with dot when scanning /proc/self/fd

Signed-off-by: Guillem Jover <guillem@hadrons.org>
This commit is contained in:
Duncan Overbruck 2024-03-05 17:01:29 +01:00 committed by Guillem Jover
parent 9cbd935d92
commit ee63bca525

View File

@ -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;