From 6c335e1c315a68283b1303afb06a3d5a34adab83 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Wed, 25 Feb 2015 22:22:50 +0100 Subject: Close file descriptors on exec. Reviewed-by: Alan Coopersmith Signed-off-by: Thomas Klausner --- choose.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'choose.c') diff --git a/choose.c b/choose.c index 6459b61..72f6bb1 100644 --- a/choose.c +++ b/choose.c @@ -98,6 +98,8 @@ GetSessionNames(int *count_ret, String **short_names_ret, if ((dir = opendir (path)) == NULL) return 0; + fcntl(dirfd(dir), F_SETFD, FD_CLOEXEC); + count = 0; while ((entry = readdir (dir)) != NULL) -- cgit v1.2.3