From turbo@bsdunix.ch  Wed Aug 28 05:12:45 2002
Return-Path: <turbo@bsdunix.ch>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D95DE37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 Aug 2002 05:12:45 -0700 (PDT)
Received: from calahan.bsdunix.ch (zux187-250.adsl.green.ch [80.254.187.250])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B5C1443E97
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 Aug 2002 05:12:43 -0700 (PDT)
	(envelope-from turbo@bsdunix.ch)
Received: from calahan.bsdunix.ch (localhost [127.0.0.1])
	by calahan.bsdunix.ch (8.12.5/8.12.5) with ESMTP id g7SCBAjn028844
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 Aug 2002 14:11:11 +0200 (CEST)
	(envelope-from turbo@bsdunix.ch)
Received: (from turbo@localhost)
	by calahan.bsdunix.ch (8.12.5/8.12.5/Submit) id g7SCBAs9028843;
	Wed, 28 Aug 2002 14:11:10 +0200 (CEST)
Message-Id: <200208281211.g7SCBAs9028843@calahan.bsdunix.ch>
Date: Wed, 28 Aug 2002 14:11:10 +0200 (CEST)
From: Thomas Vogt <turbo@bsdunix.ch>
Reply-To: Thomas Vogt <turbo@bsdunix.ch>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ftpchroot problem with lukemftpd
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         42122
>Category:       bin
>Synopsis:       ftpchroot problem with lukemftpd
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 28 05:20:01 PDT 2002
>Closed-Date:    Sun Jan 05 19:09:47 PST 2003
>Last-Modified:  Sun Jan 05 19:09:47 PST 2003
>Originator:     Thomas Vogt
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
<>
>Environment:
System: FreeBSD calahan.bsdunix.ch 4.6-STABLE FreeBSD 4.6-STABLE #1: Tue Aug 13 13:22:30 CEST 2002 root@calahan.bsdunix.ch:/usr/obj/usr/src/sys/TURBO i386

>Description:
lukemftpd fails to chroot accounts with usernames > 9 characters. 

>How-To-Repeat:
Create a user with > 9 characters and add him to /etc/ftpchroot.

>Fix:
Work around:
Only add the first 9 characters from the username in /etc/ftpchroot. Then the
account is chrooted correctly.

Fix:
Max Khon released a patch in the freebsd-stable mailinglist.

 
Index: ftpd.c
===================================================================
RCS file: /home/ncvs/src/contrib/lukemftpd/src/ftpd.c,v
retrieving revision 1.1.1.2.2.1
diff -u -p -r1.1.1.2.2.1 ftpd.c
--- ftpd.c	30 Jun 2002 06:00:51 -0000	1.1.1.2.2.1
+++ ftpd.c	27 Aug 2002 18:44:04 -0000
@@ -526,10 +526,10 @@ sgetpwnam(const char *name)
 	return (&save);
 }
 
-static int	login_attempts;	/* number of failed login attempts */
-static int	askpasswd;	/* had USER command, ask for PASSwd */
-static int	permitted;	/* USER permitted */
-static char	curname[10];	/* current USER name */
+static int	login_attempts;		/* number of failed login attempts */
+static int	askpasswd;		/* had USER command, ask for PASSwd */
+static int	permitted;		/* USER permitted */
+static char	curname[MAXLOGNAME];	/* current USER name */
 
 /*
  * USER command.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Thu Aug 29 08:47:02 PDT 2002 
Responsible-Changed-Why:  
i'm running point on lukemftpd 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42122 

From: "Sergey N. Voronkov" <serg@tmn.ru>
To: freebsd-gnats-submit@FreeBSD.org, obrien@FreeBSD.org
Cc:  
Subject: Re: bin/42122: ftpchroot problem with lukemftpd
Date: Mon, 25 Nov 2002 11:17:45 +0500

 Can you, please, commit this bugfix in the base system?
 
 ports/ftp/lukemftpd is OK for this version.
 
 (IMHO, magic number programming is BAD in any way and such things should 
 be fixed
 without talking to software author).
 
 Serg N. Voronkov,
 Sibitex JSC
 
 

From: "Sergey N. Voronkov" <serg@tmn.ru>
To: freebsd-gnats-submit@FreeBSD.org
Cc: owner-freebsd-bugs@FreeBSD.org
Subject: Re: bin/42122: ftpchroot problem with lukemftpd
Date: Wed, 27 Nov 2002 12:52:54 +0500

 Some more info:
 
 http://www.freebsd.org/cgi/cvsweb.cgi/basesrc/libexec/ftpd/ftpd.c?cvsroot=netbsd
 
 This bug was fixed in Revision 1.142 (MAIN) and 1.138.2.1(netbsd-1-6). 
 Fixup comment
 is referring to freebsd-stable maillist. I think, than would be in the 
 next lukemftpd snapshot...
 
 Could somebody please fix it after CURRENT codefreeze? It's a little 
 annoyed to have ftp/lukemftpd installed if we already have it in the 
 base system.
 
 Best Regards,
 
 Serg N. Voronkov,
 Sibitex JSC
 
 
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Sun Jan 5 19:09:39 PST 2003 
State-Changed-Why:  
fixed in latest import. 

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