NetBSD Problem Report #10075

Received: (qmail 14567 invoked from network); 8 May 2000 15:13:21 -0000
Message-Id: <200005081512.PAA19522@plucky.openg.ilx.com>
Date: Mon, 8 May 2000 15:12:50 GMT
From: "Paul J. Lavoie" <pjl@ilx.com>
Reply-To: pjl@ilx.com
To: gnats-bugs@gnats.netbsd.org
Subject: ftpd not compatible with ftpchroot in 1.4.2
X-Send-Pr-Version: 3.95

>Number:         10075
>Category:       security
>Synopsis:       ftpd not compatible with ftpchroot in 1.4.2
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    lukem
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 08 15:14:00 +0000 2000
>Closed-Date:    Wed Nov 15 03:49:32 +0000 2000
>Last-Modified:  Sun Dec 17 13:35:04 +0000 2000
>Originator:     Paul J. Lavoie
>Release:        1.4.2
>Organization:
-----------------------------------------------------------------------
Paul J. Lavoie		pjl@ilx.com		(212) 510-3029
ILX Systems, Inc.	111 Fulton St		New York, NY  10038
>Environment:

System: NetBSD plucky 1.4.2 NetBSD 1.4.2 (SERVERILX) #4: Tue Mar 21 16:27:25 EST 2000 pjl@plucky:/usr/src/sys/arch/i386/compile/SERVERILX i386


>Description:
	The ftpd daemon in 1.4.2 does not recognize accounts with an
additional argument as valid for a chroot environment. This problem is
specific with 1.4.2 - it does not appear in 1.4.1, and does not
currently exist in -current.

>How-To-Repeat:
	Place a user whose home directory is not '/' in /etc/ftpchroot
without a qualifier.
	ftp to the machine as that user
	type 'pwd'. See that the directory is not is not '/'.

>Fix:

	Place a qualifier in /etc/ftpchroot ('user yes')
	Patch ftpd. The following seems to work w/ both ftpchroot and
ftpusers tested for each of the four cases (user name not present,
user name present with no qualifier, user name present with either
'yes' or 'no' as a qualifier), but given the simplicity of the patch,
I'm paranoid that I missed something obvious.

diff libexec/ftpd/ftpd.c libexec/ftpd.orig/ftpd.c
491a492,493
>               if (perm == NULL)
>                       continue;
>Release-Note:
>Audit-Trail:

From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
To: pjl@ilx.com
Cc: gnats-bugs@gnats.netbsd.org, tron@netbsd.org, lukem@netbsd.org,
        security-officer@netbsd.org
Subject: Re: security/10075: ftpd not compatible with ftpchroot in 1.4.2 
Date: Mon, 08 May 2000 12:05:06 -0400

 lukem is cc'ed above because he's done signficiant work on ftpd; tron
 because he appears to have committed the change in question..

 > 	Place a qualifier in /etc/ftpchroot ('user yes')
 > 	Patch ftpd. The following seems to work w/ both ftpchroot and
 > ftpusers tested for each of the four cases (user name not present,
 > user name present with no qualifier, user name present with either
 > 'yes' or 'no' as a qualifier), but given the simplicity of the patch,
 > I'm paranoid that I missed something obvious.
 > 
 > diff libexec/ftpd/ftpd.c libexec/ftpd.orig/ftpd.c
 > 491a492,493
 > >               if (perm == NULL)
 > >                       continue;

 [I'm assuming that this is a reversed diff; the usual convention is to
 use context or unidiffs to show more of the code around the point of
 the change; i.e., diff -c oldfile newfile or diff -u oldfile newfile]

 At first glance, it looks like the fix is correct, but I'd like
 someone more familiar with the code to double check...

 Luke?  Tron? (you committed the change)

 					- Bill


From: Luke Mewburn <lukem@cs.rmit.edu.au>
To: security-officer@netbsd.org
Cc: pjl@ilx.com, gnats-bugs@gnats.netbsd.org, tron@netbsd.org,
        lukem@netbsd.org
Subject: Re: security/10075: ftpd not compatible with ftpchroot in 1.4.2 
Date: Wed, 10 May 2000 00:17:12 +1000

 Bill Sommerfeld writes:
 > lukem is cc'ed above because he's done signficiant work on ftpd; tron
 > because he appears to have committed the change in question..
 > 
 > > 	Place a qualifier in /etc/ftpchroot ('user yes')
 > > 	Patch ftpd. The following seems to work w/ both ftpchroot and
 > > ftpusers tested for each of the four cases (user name not present,
 > > user name present with no qualifier, user name present with either
 > > 'yes' or 'no' as a qualifier), but given the simplicity of the patch,
 > > I'm paranoid that I missed something obvious.
 > > 
 > > diff libexec/ftpd/ftpd.c libexec/ftpd.orig/ftpd.c
 > > 491a492,493
 > > >               if (perm == NULL)
 > > >                       continue;
 > 
 > [I'm assuming that this is a reversed diff; the usual convention is to
 > use context or unidiffs to show more of the code around the point of
 > the change; i.e., diff -c oldfile newfile or diff -u oldfile newfile]
 > 
 > At first glance, it looks like the fix is correct, but I'd like
 > someone more familiar with the code to double check...
 > 
 > Luke?  Tron? (you committed the change)

 Yes, I'm 99.9% certain that removing the two lines
 		if (perm == NULL)
 			continue;
 is the correct solution (because the code a few lines later checks
 that perm != NULL before strcmp()ing against it).

 ``commit the fix'' ;-)
State-Changed-From-To: open->feedback 
State-Changed-By: fair 
State-Changed-When: Wed May 24 20:00:40 PDT 2000 
State-Changed-Why:  
Itojun-san thinks this PR was solved by a change to libexec/ftpd/ftpd.c 
(version change from 1.61.2.1 to 1.61.2.2 on the 1.4.x -release branch). 
Can you confirm? 
State-Changed-From-To: feedback->closed 
State-Changed-By: lukem 
State-Changed-When: Tue Nov 14 19:49:09 PST 2000 
State-Changed-Why:  
this will be fixed in 1.4.3 and 1.5 


Responsible-Changed-From-To: security-officer->lukem 
Responsible-Changed-By: lukem 
Responsible-Changed-When: Tue Nov 14 19:49:09 PST 2000 
Responsible-Changed-Why:  
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.