From nobody@FreeBSD.ORG  Fri Sep 22 22:56:38 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 46D4B37B422; Fri, 22 Sep 2000 22:56:38 -0700 (PDT)
Message-Id: <20000923055638.46D4B37B422@hub.freebsd.org>
Date: Fri, 22 Sep 2000 22:56:38 -0700 (PDT)
From: djhill@novagate.net
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: ftpd doesn't count 
X-Send-Pr-Version: www-1.0

>Number:         21494
>Category:       misc
>Synopsis:       ftpd can't handle /etc/chroot entries without a NL
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yar
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 22 23:00:01 PDT 2000
>Closed-Date:    Tue Aug 13 05:20:25 PDT 2002
>Last-Modified:  Tue Aug 13 05:20:25 PDT 2002
>Originator:     David Hill
>Release:        4.1
>Organization:
>Environment:
FreeBSD beast.hill.hom 4.1-STABLE FreeBSD 4.1-STABLE #5: Thu Sep 14 17:00:50 EDT 2000     root@beast.hill.hom:/usr/src/sys/compile/BEAST  i386
>Description:
When adding a user to /etc/ftpchroot without hitting enter at the end
(does not at \n), ftpd will fail to check the username.  Ok, maybe I
am being picky, but when I had to add only one username to
/etc/ftpchroot, and it wasn't working, I finally remembered to hit enter.
A patch is available below (could it hurt it add it?)
>How-To-Repeat:
add a user to /etc/ftpchroot without hitting enter at the end.
>Fix:
--- ftpd.c.orig Wed Sep 20 05:57:57 2000
+++ ftpd.c      Sat Sep 23 01:53:33 2000
@@ -977,7 +977,7 @@

        if ((fd = fopen(fname, "r")) != NULL) {
                while (!found && fgets(line, sizeof(line), fd) != NULL)
-                       if ((p = strchr(line, '\n')) != NULL) {
+                       if (((p = strchr(line, '\n')) != NULL) || (p = strchr(line, '\0')) != NULL) {
                                *p = '\0';
                                if (line[0] == '#')
                                        continue;

>Release-Note:
>Audit-Trail:

From: djhill@novagate.net
To: freebsd-gnats-submit@FreeBSD.ORG
Cc:  
Subject: misc/21494: ftpd doesn't count 
Date: Fri, 22 Sep 2000 22:56:38 -0700 (PDT)

 >Number:         21494
 >Category:       misc
 >Synopsis:       ftpd doesn't count
 >Confidential:   no
 >Severity:       non-critical
 >Priority:       low
 >Responsible:    freebsd-bugs
 >State:          open
 >Quarter:        
 >Keywords:       
 >Date-Required:
 >Class:          sw-bug
 >Submitter-Id:   current-users
 >Arrival-Date:   Fri Sep 22 23:00:01 PDT 2000
 >Closed-Date:
 >Last-Modified:
 >Originator:     David Hill
 >Release:        4.1
 >Organization:
 >Environment:
 FreeBSD beast.hill.hom 4.1-STABLE FreeBSD 4.1-STABLE #5: Thu Sep 14 17:00:50 EDT 2000     root@beast.hill.hom:/usr/src/sys/compile/BEAST  i386
 >Description:
 When adding a user to /etc/ftpchroot without hitting enter at the end
 (does not at \n), ftpd will fail to check the username.  Ok, maybe I
 am being picky, but when I had to add only one username to
 /etc/ftpchroot, and it wasn't working, I finally remembered to hit enter.
 A patch is available below (could it hurt it add it?)
 >How-To-Repeat:
 add a user to /etc/ftpchroot without hitting enter at the end.
 >Fix:
 --- ftpd.c.orig Wed Sep 20 05:57:57 2000
 +++ ftpd.c      Sat Sep 23 01:53:33 2000
 @@ -977,7 +977,7 @@
 
         if ((fd = fopen(fname, "r")) != NULL) {
                 while (!found && fgets(line, sizeof(line), fd) != NULL)
 -                       if ((p = strchr(line, '\n')) != NULL) {
 +                       if (((p = strchr(line, '\n')) != NULL) || (p = strchr(line, '\0')) != NULL) {
                                 *p = '\0';
                                 if (line[0] == '#')
                                         continue;
 
 >Release-Note:
 >Audit-Trail:
 >Unformatted:
 
 
 To Unsubscribe: send mail to majordomo@FreeBSD.org
 with "unsubscribe freebsd-bugs" in the body of the message
 
 
Responsible-Changed-From-To: freebsd-bugs->mikeh 
Responsible-Changed-By: mikeh 
Responsible-Changed-When: Thu Jun 28 20:23:02 PDT 2001 
Responsible-Changed-Why:  
I'll look at this. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21494 
Responsible-Changed-From-To: mikeh->yar 
Responsible-Changed-By: mikeh 
Responsible-Changed-When: Mon Dec 24 12:36:14 PST 2001 
Responsible-Changed-Why:  
Yar has looked at this and made more progress than I have so far. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21494 
State-Changed-From-To: open->patched 
State-Changed-By: yar 
State-Changed-When: Fri Jul 12 08:52:20 PDT 2002 
State-Changed-Why:  
CURRENT fixed, MFC pending. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21494 
State-Changed-From-To: patched->feedback 
State-Changed-By: yar 
State-Changed-When: Mon Aug 12 08:07:59 PDT 2002 
State-Changed-Why:  
The bug is fixed in STABLE & CURRENT. 
Is the problem gone in your configuration? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21494 
State-Changed-From-To: feedback->closed 
State-Changed-By: yar 
State-Changed-When: Tue Aug 13 05:19:47 PDT 2002 
State-Changed-Why:  
Originator's email is gone. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21494 
>Unformatted:
