summaryrefslogtreecommitdiff
path: root/security/ssh/patches/patch-aq
blob: 1de53ceb568ec430564b241598e3b87bcb34c063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
$NetBSD: patch-aq,v 1.2 1999/05/26 15:35:43 tv Exp $

--- newchannels.c.orig	Wed May 12 13:19:27 1999
+++ newchannels.c	Sat May 15 04:31:04 1999
@@ -274,7 +274,7 @@
 #include "authfd.h"
 #include "emulate.h"
 #include "servconf.h"
-#ifdef LIBWRAP
+#if defined(LIBWRAP) && defined(LIBWRAP_FWD)
 #include <tcpd.h>
 #include <syslog.h>
 #ifdef NEED_SYS_SYSLOG_H
@@ -934,7 +934,7 @@
               snprintf(buf, sizeof(buf), "X11 connection from %.200s port %d",
                       remote_hostname, get_peer_port(newsock));
               xfree(remote_hostname);
-#ifdef LIBWRAP
+#if defined(LIBWRAP) && defined(LIBWRAP_FWD)
               {
                 struct request_info req;
                 struct servent *serv;
@@ -986,7 +986,7 @@
                        ch->listening_port, remote_hostname,
                        get_peer_port(newsock));
               xfree(remote_hostname);
-#ifdef LIBWRAP
+#if defined(LIBWRAP) && defined(LIBWRAP_FWD)
               {
                 struct request_info req;
                 struct servent *serv;
@@ -2412,6 +2412,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));