Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 2009 13:27:02 +0200
From:      Dimitry Andric <dimitry@andric.com>
To:        Tobias Fendin <tobias.fendin@glocalnet.net>
Cc:        Glen Barber <glen.j.barber@gmail.com>, hackers@freebsd.org, bug-followup@freebsd.org
Subject:   Re: bin/134694: gives false-positive when unable to obtain socket [WAS: sshd(8) - alert user when fails to execute from rc.d]
Message-ID:  <4A13E906.7020907@andric.com>
In-Reply-To: <4A13E6F7.7070309@glocalnet.net>
References:  <4ad871310905181949s2874795eoa5ddf425746310bf@mail.gmail.com>	<Ef8BU7l8PyKhYzlJNCX2WAa41WY@cgr/Aoyjz11KtFDB23HMnFSn04s> <4A13E180.1040606@andric.com> <4A13E6F7.7070309@glocalnet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2009-05-20 13:18, Tobias Fendin wrote:
> Does the child really die? I did a little test:
> 
> # /etc/rc.d/sshd status
> sshd is not running.
> # nc -l 22 >/tmp/ssh_test &
> [1] 1733
> # /etc/rc.d/sshd start
> Starting sshd.
> # /etc/rc.d/sshd status
> sshd is running as pid 1740.

This is because sshd binds to both IPv4 and IPv6 ports.  The IPv4 bind
fails, as you will see in syslog, while the IPv6 bind succeeds.  Thus
sshd keeps on running.

If you start two nc's (I don't know any way to do this with one
instance), e.g.:

nc -4 -l 22 > /tmp/ssh_test4 &
nc -6 -l 22 > /tmp/ssh_test6 &

and then try starting sshd, you should see it quit.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A13E906.7020907>