From jim@komodo.reptiles.org  Fri Oct 31 14:56:23 1997
Received: from komodo.reptiles.org (komodo.reptiles.org [198.96.117.142])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id OAA11106
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 31 Oct 1997 14:56:19 -0800 (PST)
          (envelope-from jim@komodo.reptiles.org)
Received: from localhost (1568 bytes) by komodo.reptiles.org
	via sendmail with P:stdio/R:bind_hosts/T:inet_zone_bind_smtp
	(sender: <jim>) (ident <jim> using unix)
	id <m0xRPxH-0009zqC@komodo.reptiles.org>
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 31 Oct 1997 17:54:15 -0500 (EST)
	(Smail-3.2.0.98 1997-Oct-16 #1 built 1997-Oct-21)
Message-Id: <m0xRPxH-0009zqC@komodo.reptiles.org>
Date: Fri, 31 Oct 1997 17:54:15 -0500 (EST)
From: jim@komodo.reptiles.org
Reply-To: jim@komodo.reptiles.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: tftpd does not log when chroot is enabled
X-Send-Pr-Version: 3.2

>Number:         4910
>Category:       bin
>Synopsis:       tftpd does not log when chroot is enabled
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 31 15:00:00 PST 1997
>Closed-Date:    Sun Apr 12 04:16:00 PDT 1998
>Last-Modified:  Sun Apr 12 04:16:17 PDT 1998
>Originator:     Jim Mercer
>Release:        FreeBSD 2.2.5-RELEASE i386
>Organization:
Reptilian Research
>Environment:

FreeBSD komodo.reptiles.org 2.2.5-RELEASE FreeBSD 2.2.5-RELEASE #0: Wed Oct 22 17:30:35 EDT 1997     root@komodo.reptiles.org:/usr/src/sys/compile/KOMODO  i386

>Description:

openlog() needs to have LOG_NDELAY added, or else the syslog() calls after
the chroot will not get sent to syslogd.

>How-To-Repeat:

in /etc/inetd.conf:

logging, no chroot, works fine:
tftp dgram udp wait nobody /usr/libexec/tftpd	tftpd -l

logging, with chroot, no logging after chroot
tftp dgram udp wait root   /usr/libexec/tftpd	tftpd -l -s /tftpboot

>Fix:
	
*** tftpd.c	Fri Oct 31 15:38:27 1997
--- tftpd.c.old	Fri Oct 31 14:54:44 1997
***************
*** 120,126 ****
  	char *chroot_dir = NULL;
  	struct passwd *nobody;
  
! 	openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP);
  	while ((ch = getopt(argc, argv, "lns:")) != EOF) {
  		switch (ch) {
  		case 'l':
--- 120,126 ----
  	char *chroot_dir = NULL;
  	struct passwd *nobody;
  
! 	openlog("tftpd", LOG_PID, LOG_FTP);
  	while ((ch = getopt(argc, argv, "lns:")) != EOF) {
  		switch (ch) {
  		case 'l':

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Sun Apr 12 04:16:00 PDT 1998 
State-Changed-Why:  
committed, thanks! 
>Unformatted:
