summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/ssh/authfd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/ssh/authfd.c b/usr.bin/ssh/authfd.c
index 99478e7a054..34c68711c39 100644
--- a/usr.bin/ssh/authfd.c
+++ b/usr.bin/ssh/authfd.c
@@ -14,7 +14,7 @@ Functions for connecting the local authentication agent.
*/
#include "includes.h"
-RCSID("$Id: authfd.c,v 1.9 1999/11/15 20:53:24 markus Exp $");
+RCSID("$Id: authfd.c,v 1.10 1999/11/16 22:52:55 markus Exp $");
#include "ssh.h"
#include "rsa.h"
@@ -45,6 +45,13 @@ ssh_get_authentication_socket()
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0)
return -1;
+
+ /* close on exec */
+ if (fcntl(sock, F_SETFD, 1) == -1)
+ {
+ close(sock);
+ return -1;
+ }
if (connect(sock, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) < 0)
{