summaryrefslogtreecommitdiff
path: root/authfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'authfd.c')
-rw-r--r--authfd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/authfd.c b/authfd.c
index c11c3f5a8..f037e838b 100644
--- a/authfd.c
+++ b/authfd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: authfd.c,v 1.84 2010/08/31 11:54:45 djm Exp $ */ 1/* $OpenBSD: authfd.c,v 1.86 2011/07/06 18:09:21 tedu Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -102,6 +102,7 @@ ssh_get_authentication_socket(void)
102 if (!authsocket) 102 if (!authsocket)
103 return -1; 103 return -1;
104 104
105 bzero(&sunaddr, sizeof(sunaddr));
105 sunaddr.sun_family = AF_UNIX; 106 sunaddr.sun_family = AF_UNIX;
106 strlcpy(sunaddr.sun_path, authsocket, sizeof(sunaddr.sun_path)); 107 strlcpy(sunaddr.sun_path, authsocket, sizeof(sunaddr.sun_path));
107 108
@@ -110,7 +111,7 @@ ssh_get_authentication_socket(void)
110 return -1; 111 return -1;
111 112
112 /* close on exec */ 113 /* close on exec */
113 if (fcntl(sock, F_SETFD, 1) == -1) { 114 if (fcntl(sock, F_SETFD, FD_CLOEXEC) == -1) {
114 close(sock); 115 close(sock);
115 return -1; 116 return -1;
116 } 117 }