From xaa@dohd.org  Sun Jun 17 00:26:21 2001
Return-Path: <xaa@dohd.org>
Received: from nala.dohd.org (a29150.upc-a.chello.nl [62.163.29.150])
	by hub.freebsd.org (Postfix) with ESMTP id 8491637B406
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 17 Jun 2001 00:26:20 -0700 (PDT)
	(envelope-from xaa@dohd.org)
Received: from tiggr.local.dohd.org (tiggr6.local.dohd.org [2001:610:1108:5201:250:fcff:fe0b:c665])
	by nala.dohd.org (Postfix) with ESMTP id 95CF0D906
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 17 Jun 2001 09:26:19 +0200 (MET DST)
Received: by tiggr.local.dohd.org (Postfix, from userid 1002)
	id 669D65E07; Sun, 17 Jun 2001 09:26:19 +0200 (CEST)
Message-Id: <20010617072619.669D65E07@tiggr.local.dohd.org>
Date: Sun, 17 Jun 2001 09:26:19 +0200 (CEST)
From: xaa@dohd.org
Reply-To: xaa@dohd.org
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ftpd doesn't honor invalid shelll in login class
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         28224
>Category:       bin
>Synopsis:       ftpd doesn't honor invalid shelll in login class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    yar
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 17 00:30:03 PDT 2001
>Closed-Date:    Sat Oct 30 16:32:10 GMT 2004
>Last-Modified:  Sat Oct 30 16:32:10 GMT 2004
>Originator:     Mark Huizer
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Via Net.Works Netherlands
>Environment:
System: FreeBSD tiggr.local.dohd.org 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Sat Jun 2 10:41:56 MET DST 2001 xaa@eeyore.local.dohd.org:/usr2/sources/obj/usr2/sources/src/sys/tiggr i386


	FreeBSD -current and probably all releases since at least 2.2.7
	(see the 'closed' PR bin/9516)
>Description:
   a user in a login class with an invalid shell (think 'lockout class')
   can ftp to his account without any trouble.

       
>How-To-Repeat:
   create lockoutclass with /usr/bin/false as shell, change user to that
   class, ftp to his account
>Fix:

 The old patch might still apply, but anyway, the idea is clear:

patch to libexec/ftpd.c

     772a773,775
     > #ifdef LOGIN_CAP
     >       login_cap_t *lc = NULL;
     > #endif
     811a815,825
     > #ifdef LOGIN_CAP
     >               lc = login_getpwclass(pw);
     >               if (lc == NULL) {
     >                       if ((shell = pw->pw_shell) == NULL || *shell == 0)
     >                               shell = _PATH_BSHELL;
     >               } else {
     >                       shell = login_getcapstr(lc, "shell", pw->pw_shell, pw->pw_shell);
     >                       if (shell==NULL || *shell == 0)
     >                               shell = _PATH_BSHELL;
     >               }
     > #else
     813a828
     > #endif
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->yar 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Jul 12 18:22:59 PDT 2003 
Responsible-Changed-Why:  
Assign to ftpd maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=28224 
State-Changed-From-To: open->closed 
State-Changed-By: yar 
State-Changed-When: Sat Oct 30 16:26:16 GMT 2004 
State-Changed-Why:  
The "shell" string in login.conf isn't for locking users out. 
Please see the "pw lock" command and how it works--that command 
is the recommended way of locking users out in FreeBSD. 

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