From 57666b9434297fa49e4727e6fdc41b7b61b94094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 27 Jul 2008 12:16:15 +0000 Subject: [PATCH] close-on-exec git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23466 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hcrypto/ui.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/hcrypto/ui.c b/lib/hcrypto/ui.c index 53d3ca38d..05f44bc66 100644 --- a/lib/hcrypto/ui.c +++ b/lib/hcrypto/ui.c @@ -84,7 +84,9 @@ read_string(const char *preprompt, const char *prompt, if (sigaction(i, &sa, &sigs[i]) == 0) oksigs[i] = 1; - if((tty = fopen("/dev/tty", "r")) == NULL) + if((tty = fopen("/dev/tty", "r")) != NULL) + rk_cloexec_file(tty); + else tty = stdin; fprintf(stderr, "%s%s", preprompt, prompt);