summaryrefslogtreecommitdiffstats
path: root/authfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'authfd.c')
-rw-r--r--authfd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/authfd.c b/authfd.c
index 84a5fc742..55ad13e3a 100644
--- a/authfd.c
+++ b/authfd.c
@@ -14,7 +14,7 @@ Functions for connecting the local authentication agent.
*/
#include "includes.h"
-RCSID("$Id: authfd.c,v 1.4 1999/11/16 02:37:16 damien Exp $");
+RCSID("$Id: authfd.c,v 1.5 1999/11/17 06:29:08 damien Exp $");
#include "ssh.h"
#include "rsa.h"
@@ -50,6 +50,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)
{