1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00
freebsd-ports/security/ssh/files/patch-ao
John Polstra 4b40e7aa2b Prevent this server error message:
fatal: Local: Agent socket bind failed: Address already in use

It would happen when the server tried to create the Unix domain
socket "/tmp/ssh-username/agent-socket-123", if the file already
existed.  It could already exist if it happened to be left over from
a system crash.  This patch unlinks the file before attempting the
bind operation.

I will send this patch to ssh-bugs@cs.hut.fi too.
1997-07-19 19:28:35 +00:00

14 lines
538 B
Plaintext

--- newchannels.c.orig Tue Apr 22 17:40:11 1997
+++ newchannels.c Sat Jul 19 11:42:06 1997
@@ -2139,6 +2139,10 @@
ssh-agent connections on your system */
old_umask = umask(S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
+ /* Make sure the socket doesn't already exist, left over from a system
+ crash perhaps. */
+ unlink(channel_forwarded_auth_socket_name);
+
if (bind(sock, (struct sockaddr *)&sunaddr, AF_UNIX_SIZE(sunaddr)) < 0)
packet_disconnect("Agent socket bind failed: %.100s", strerror(errno));