From ftobin@srh0710.urh.uiuc.edu Wed Jun 16 04:14:29 1999
Return-Path: <ftobin@srh0710.urh.uiuc.edu>
Received: from srh0710.urh.uiuc.edu (srh0710.urh.uiuc.edu [130.126.76.32])
	by hub.freebsd.org (Postfix) with SMTP id 4CE9F15198
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 16 Jun 1999 04:13:24 -0700 (PDT)
	(envelope-from ftobin@srh0710.urh.uiuc.edu)
Received: (qmail 44316 invoked by uid 1000); 16 Jun 1999 11:13:24 -0000
Message-Id: <19990616111324.44315.qmail@srh0710.urh.uiuc.edu>
Date: 16 Jun 1999 11:13:24 -0000
From: ftobin@bigfoot.com
Sender: ftobin@srh0710.urh.uiuc.edu
Reply-To: ftobin@bigfoot.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: inetd fails re-config on HUP
X-Send-Pr-Version: 3.2

>Number:         12240
>Category:       bin
>Synopsis:       inetd fails re-config from inetd.conf correctly on HUP
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 16 04:20:00 PDT 1999
>Closed-Date:    Mon Jun 21 01:55:45 PDT 1999
>Last-Modified:  Mon Jun 21 01:56:51 PDT 1999
>Originator:     Frank Tobin
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
>Environment:

uname -a:
FreeBSD srh0710.urh.uiuc.edu 3.2-STABLE
  FreeBSD 3.2-STABLE #11: Tue Jun 15 20:41:00 CDT 1999 
  root@srh0710.urh.uiuc.edu:/usr/src/sys/compile/SOLACE 

FreeBSD-STABLE make world as of June 16.
	
>Description:

inetd rereads the inetd.conf file incorrectly when given a HUP.
By doing some simple testing in inetd.c with printf's, it
seems it does not set se_server_name correctly at a minumum.
It probably does not set se_server correctly either.  This has a
wide range of effects, specifically causing /etc/hosts.allow to
not process correctly on a per-server basis.

>How-To-Repeat:

I have the following inetd.conf file:

ident	stream	tcp	wait	kmem:kmem	/usr/local/sbin/identd	identd -w -t120
smtp	stream	tcp	nowait	qmaild		/var/qmail/bin/tcp-env	tcp-env /var/qmail/bin/qmail-smtpd

Start inetd as normal.  This is the inetd that is libwrapped.
Verify that one can connect to the second service,
tcp-env in this case.  In hosts.allow have:

tcp-env : ALL : allow
ALL : DENY : twist /bin/echo %s

Now HUP inetd.  One cannot connect to port 25, tcp-env; the connect
is wrap-dropped.  Analysis of the though-to-be server name is printed
as _@foo.bar.com.  On the other hand, the first service, idnetd is
not blocked at all.  Neither tcp-env nor identd are libwrapped
internally.  All wrapping is supposed to be performed by inetd, no?

>Fix:

Unknown at the moment; currently, avoid HUPing inetd; just
kill, restart.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Mon Jun 21 01:55:45 PDT 1999 
State-Changed-Why:  
Duplicate of PR 11860. Fixed in rev 1.50 of inetd.c . 
>Unformatted:
