From owner-freebsd-hackers@FreeBSD.ORG Wed May 20 11:27:01 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E104C1065670; Wed, 20 May 2009 11:27:01 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id A07498FC18; Wed, 20 May 2009 11:27:01 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from [IPv6:2001:7b8:3a7:0:8d33:c8ee:aff8:342] (unknown [IPv6:2001:7b8:3a7:0:8d33:c8ee:aff8:342]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id BBABF5C42; Wed, 20 May 2009 13:27:00 +0200 (CEST) Message-ID: <4A13E906.7020907@andric.com> Date: Wed, 20 May 2009 13:27:02 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1b5pre) Gecko/20090515 Shredder/3.0b3pre MIME-Version: 1.0 To: Tobias Fendin References: <4ad871310905181949s2874795eoa5ddf425746310bf@mail.gmail.com> <4A13E180.1040606@andric.com> <4A13E6F7.7070309@glocalnet.net> In-Reply-To: <4A13E6F7.7070309@glocalnet.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Glen Barber , 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] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 11:27:02 -0000 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.