From owner-freebsd-bugs@FreeBSD.ORG Mon Feb 19 11:06:34 2007 Return-Path: X-Original-To: freebsd-bugs@freebsd.org Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5895316A402 for ; Mon, 19 Feb 2007 11:06:34 +0000 (UTC) (envelope-from aragon@phat.za.net) Received: from mail.geek.sh (decoder.geek.sh [196.36.198.81]) by mx1.freebsd.org (Postfix) with ESMTP id B204713C471 for ; Mon, 19 Feb 2007 11:06:33 +0000 (UTC) (envelope-from aragon@phat.za.net) Received: by mail.geek.sh (Postfix, from userid 1000) id 2BFD224D1F; Mon, 19 Feb 2007 12:41:27 +0200 (SAST) Date: Mon, 19 Feb 2007 12:41:27 +0200 From: Aragon Gouveia To: Maxim Konovalov , David Malone Message-ID: <20070219104127.GA16728@phat.za.net> References: <20061020201554.GA9906@phat.za.net> <20061110161054.P24498@mp2.macomnet.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061110161054.P24498@mp2.macomnet.net> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 4.10-RELEASE-p2 i386 Cc: freebsd-bugs@freebsd.org Subject: Re: inetd UNIX socket bug (and small fix) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Feb 2007 11:06:34 -0000 Hi all, Sorry to drag this one out. I eventually tried creating a unix type entry in inetd.conf on a 6.2-RELEASE machine. The behaviour is still the same. Maxim, I tried copy/pasting your entry (changed user/group though) into my inetd.conf, but it made no difference for me. I do not understand how your's is working and none of mine aren't? Anyway, I have logged a PR for this. Number is 109315. Thanks, Aragon | By Maxim Konovalov | [ 2006-11-10 15:14 +0200 ] > On Fri, 20 Oct 2006, 22:15+0200, Aragon Gouveia wrote: > > > Hello, > > > > I have been trying to setup a UNIX socket service in inetd, but it appears > > the functionality has been broken for some time. I guess I'm the first to > > notice. > > > > With a UNIX socket service entry in inetd.conf the socket file is created as > > it should be, but when I try make a connection to the socket, it establishes > > and then immediately closes. There is nothing logged to syslog and not > > much info when in debug mode (inetd -d). > > > > In my code references below I should mention that I'm still running > > 4.10-RELEASE so my line numbering might be out. But from looking at HEAD > > via CVSweb it looks like the bug is still there. Hopefully this > > information is of relevance. > > > > I had a look through inetd.c and found the following in cpmip() starting at > > line 2202: > > > > --- > > case AF_INET: > > p = (char *)&sin4->sin_addr; > > addrlen = sizeof(struct in_addr); > > break; > > #ifdef INET6 > > case AF_INET6: > > p = (char *)&sin6->sin6_addr; > > addrlen = sizeof(struct in6_addr); > > break; > > #endif > > default: > > /* should not happen */ > > return -1; > > } > > --- > > > > There is no case entry for AF_UNIX. From my testing execution was reaching > > the default: entry when an AF_UNIX connection was established. When cpmip() > > returns a negative value it looks like inetd silently closes the socket. > > > > At the bottom of this message is a patch which seems to make it work. The > > only oddity is that when logging is enabled (inetd -l), AF_UNIX connections > > are logged as coming from "unknown". No biggie for me, but there might be a > > better fix. > > > > Should I create a PR for this? > > inetd over AF_UNIX works OK on RELENG_4 and HEAD. I've just added > > :maxim:maxim:220:/tmp/telnet stream unix nowait root /usr/libexec/telnetd telnetd > > to inetd.conf and was able to login to my system via telnet -u /tmp/telnet. > > Builtin services like chargen work over AF_UNIX sockets too.