Summary: | Resolve failure in OpenSSH 3.4p1 when using PrivilegeSeperation in 4.5-RELEASE | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | jestrix <jestrix> |
Component: | Individual Port(s) | Assignee: | Dirk Meyer <dinoex> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | ||
Priority: | Normal | ||
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any |
Description
jestrix
2002-06-28 16:50:01 UTC
Same problem here, except it only happens inside of a jail, not on the host system. I can duplicate it on both jails using the same configuration file as the host system. DNS is working properly on every other application in the jails as well. Responsible Changed From-To: freebsd-ports->dinoex I will look into this. The resolver library is sometimes not inizialized, and it can't after chroot is done. Workaround: create on of this files with the correct nameserver: /usr/local/empty/etc/resolv.conf /var/empty/etc/resolv.conf I tried created the files for the workaround inside the jails but they didn't change anything. I did restart sshd just in case it needed to have the parent process reinitialize. Only thing that isn't very standard is that the nameserver line points to the jail's own IP, not another host or 127.0.0.1.=20 E-mail me if you want to have me test out any patches for this though, would love to get rid of the long delay in jail SSH sessions. I still can't repoduce the problem as described, but this patch should fix it. Please check if this solves the problem. kind regards Dirk - Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany - [dirk.meyer@dinoex.sub.org],[dirk.meyer@guug.de],[dinoex@FreeBSD.org] --- 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 dirk.meyer@dinoex.sub.org (Dirk Meyer) writes: > I still can't repoduce the problem as described, > but this patch should fix it. It looks good, though a simple (void)gethostbyname("localhost") should be just as effective. DES -- Dag-Erling Smorgrav - des@ofug.org Oops, the workaround DOES work in the jail, it's just I forgot to chmod 755 /var/empty. But that doesn't matter anymore. I have patched OpenSSH and the delay is gone. Now to just get this back into OpenSSH or the port patches... :) - Robert State Changed From-To: open->closed Commited, Thanks. |