summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorKevin Steves <stevesk@cvs.openbsd.org>2001-09-19 19:35:31 +0000
committerKevin Steves <stevesk@cvs.openbsd.org>2001-09-19 19:35:31 +0000
commit99cd09c1c7f4c1fa28f1275519e8d1043c9b5231 (patch)
treee620710caa01ebb3055ae8a4e9c494873b22c02b /usr.bin
parent1b7995829ae285b9754c8f39fa319d8fadbd42b9 (diff)
use sizeof addr vs. SUN_LEN(addr) for sockaddr_un. Stevens blesses
this and we do it this way elsewhere. this helps in portable because not all systems have SUN_LEN() and sockaddr_un.sun_len. ok markus@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/authfd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/ssh/authfd.c b/usr.bin/ssh/authfd.c
index da99f1bbeb9..d6366ee36c7 100644
--- a/usr.bin/ssh/authfd.c
+++ b/usr.bin/ssh/authfd.c
@@ -35,7 +35,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: authfd.c,v 1.44 2001/08/07 10:37:46 markus Exp $");
+RCSID("$OpenBSD: authfd.c,v 1.45 2001/09/19 19:35:30 stevesk Exp $");
#include <openssl/evp.h>
@@ -67,7 +67,7 @@ int
ssh_get_authentication_socket(void)
{
const char *authsocket;
- int sock, len;
+ int sock;
struct sockaddr_un sunaddr;
authsocket = getenv(SSH_AUTHSOCKET_ENV_NAME);
@@ -76,8 +76,6 @@ ssh_get_authentication_socket(void)
sunaddr.sun_family = AF_UNIX;
strlcpy(sunaddr.sun_path, authsocket, sizeof(sunaddr.sun_path));
- len = SUN_LEN(&sunaddr)+1;
- sunaddr.sun_len = len;
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0)
@@ -88,7 +86,7 @@ ssh_get_authentication_socket(void)
close(sock);
return -1;
}
- if (connect(sock, (struct sockaddr *) & sunaddr, len) < 0) {
+ if (connect(sock, (struct sockaddr *) &sunaddr, sizeof sunaddr) < 0) {
close(sock);
return -1;
}