authfd.c (3cc95ad9) authfd.c (69881b76)
1/* $OpenBSD: authfd.c,v 1.91 2013/12/29 04:29:25 djm Exp $ */
1/* $OpenBSD: authfd.c,v 1.92 2014/01/31 16:39:19 tedu Exp $ */
2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved
6 * Functions for connecting the local authentication agent.
7 *
8 * As far as I am concerned, the code I have written for this software
9 * can be used freely for any purpose. Any derived versions of this

--- 85 unchanged lines hidden (view full) ---

95 const char *authsocket;
96 int sock;
97 struct sockaddr_un sunaddr;
98
99 authsocket = getenv(SSH_AUTHSOCKET_ENV_NAME);
100 if (!authsocket)
101 return -1;
102
2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved
6 * Functions for connecting the local authentication agent.
7 *
8 * As far as I am concerned, the code I have written for this software
9 * can be used freely for any purpose. Any derived versions of this

--- 85 unchanged lines hidden (view full) ---

95 const char *authsocket;
96 int sock;
97 struct sockaddr_un sunaddr;
98
99 authsocket = getenv(SSH_AUTHSOCKET_ENV_NAME);
100 if (!authsocket)
101 return -1;
102
103 bzero(&sunaddr, sizeof(sunaddr));
103 memset(&sunaddr, 0, sizeof(sunaddr));
104 sunaddr.sun_family = AF_UNIX;
105 strlcpy(sunaddr.sun_path, authsocket, sizeof(sunaddr.sun_path));
106
107 sock = socket(AF_UNIX, SOCK_STREAM, 0);
108 if (sock < 0)
109 return -1;
110
111 /* close on exec */

--- 544 unchanged lines hidden ---
104 sunaddr.sun_family = AF_UNIX;
105 strlcpy(sunaddr.sun_path, authsocket, sizeof(sunaddr.sun_path));
106
107 sock = socket(AF_UNIX, SOCK_STREAM, 0);
108 if (sock < 0)
109 return -1;
110
111 /* close on exec */

--- 544 unchanged lines hidden ---