aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssh/sshd.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2003-01-22 14:12:59 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2003-01-22 14:12:59 +0000
commit84860c33f05f7c738f3a1c4ced4a489e065d1f84 (patch)
treeaeb448cbc9cb48aa81f9699176b0db630064f622 /crypto/openssh/sshd.c
parentd50ea522c17c488ac22861dea53d7bde1a79bc2f (diff)
downloadsrc-84860c33f05f7c738f3a1c4ced4a489e065d1f84.tar.gz
src-84860c33f05f7c738f3a1c4ced4a489e065d1f84.zip
Force early initialization of the resolver library, since the resolver
configuration files will no longer be available once sshd is chrooted. PR: 39953, 40894 Submitted by: dinoex MFC after: 3 days
Notes
Notes: svn path=/head/; revision=109683
Diffstat (limited to 'crypto/openssh/sshd.c')
-rw-r--r--crypto/openssh/sshd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c
index 4a8e4cc0f52e..cb25d36bf3f1 100644
--- a/crypto/openssh/sshd.c
+++ b/crypto/openssh/sshd.c
@@ -54,6 +54,10 @@ RCSID("$FreeBSD$");
#include <prot.h>
#endif
+#ifdef __FreeBSD__
+#include <resolv.h>
+#endif
+
#include "ssh.h"
#include "ssh1.h"
#include "ssh2.h"
@@ -1418,6 +1422,17 @@ main(int ac, char **av)
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
* not have a key.