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
This commit is contained in:
Dag-Erling Smørgrav 2003-01-22 14:12:59 +00:00
parent d50ea522c1
commit 84860c33f0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109683

View File

@ -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.