Fix resolver problem with privilege-separation.

PR:		39953
This commit is contained in:
Dirk Meyer 2002-07-27 06:20:28 +00:00
parent 023dfb6d8b
commit cbf06429f9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=63623
4 changed files with 64 additions and 2 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= openssh
PORTVERSION= 3.4p1
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= security ipv6
MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
ftp://ftp.op.net/pub/OpenBSD/OpenSSH/portable/ \

View File

@ -0,0 +1,31 @@
--- sshd.c.orig Wed Jun 26 01:24:19 2002
+++ sshd.c Thu Jul 25 06:32:37 2002
@@ -53,6 +53,10 @@
#include <prot.h>
#endif
+#ifdef __FreeBSD__
+#include <resolv.h>
+#endif
+
#include "ssh.h"
#include "ssh1.h"
#include "ssh2.h"
@@ -1409,6 +1413,17 @@
setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on,
sizeof(on)) < 0)
error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno));
+
+#ifdef __FreeBSD__
+ /*
+ * Initialize the resolver. This may not happen automatically
+ * before privsep chroot().
+ */
+ if ((_res.options & RES_INIT) == 0) {
+ debug("res_init()");
+ res_init();
+ }
+#endif
/*
* Register our connection. This turns encryption off because we do

View File

@ -7,7 +7,7 @@
PORTNAME= openssh
PORTVERSION= 3.4p1
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= security ipv6
MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
ftp://ftp.op.net/pub/OpenBSD/OpenSSH/portable/ \

View File

@ -0,0 +1,31 @@
--- sshd.c.orig Wed Jun 26 01:24:19 2002
+++ sshd.c Thu Jul 25 06:32:37 2002
@@ -53,6 +53,10 @@
#include <prot.h>
#endif
+#ifdef __FreeBSD__
+#include <resolv.h>
+#endif
+
#include "ssh.h"
#include "ssh1.h"
#include "ssh2.h"
@@ -1409,6 +1413,17 @@
setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on,
sizeof(on)) < 0)
error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno));
+
+#ifdef __FreeBSD__
+ /*
+ * Initialize the resolver. This may not happen automatically
+ * before privsep chroot().
+ */
+ if ((_res.options & RES_INIT) == 0) {
+ debug("res_init()");
+ res_init();
+ }
+#endif
/*
* Register our connection. This turns encryption off because we do