From nobody@FreeBSD.ORG  Tue Oct 24 13:21:02 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 57DA337B4CF; Tue, 24 Oct 2000 13:21:02 -0700 (PDT)
Message-Id: <20001024202102.57DA337B4CF@hub.freebsd.org>
Date: Tue, 24 Oct 2000 13:21:02 -0700 (PDT)
From: kway@wgate.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: rmuser does not allow deletion of all usernames that adduser can create
X-Send-Pr-Version: www-1.0

>Number:         22278
>Category:       misc
>Synopsis:       [MFC] rmuser does not allow deletion of all usernames that adduser can create
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 24 13:30:03 PDT 2000
>Closed-Date:    Sun Jan 14 02:34:08 PST 2001
>Last-Modified:  Sun Jan 14 02:34:45 PST 2001
>Originator:     Kevin Way
>Release:        4.1.1
>Organization:
WorldGate Communications
>Environment:
FreeBSD way.eng.tvol.net 4.1.1-STABLE FreeBSD 4.1.1-STABLE #0: Fri Oct 13 15:02:15 EDT 2000     root@way.eng.tvol.net:/usr/obj/usr/src/sys/KEVIN  i386
>Description:
rmuser does not allow deletion of all usernames for which adduser allows
creation.  In particular, usernames with a - in them.
>How-To-Repeat:
adduser with foo-bar
rmuser foo-bar
>Fix:
--- rmuser.perl.bak     Tue Oct 24 16:05:49 2000
+++ rmuser.perl Tue Oct 24 16:20:35 2000
@@ -108,7 +108,7 @@
     # Username was given as a parameter
     $login_name = pop(@ARGV);
     die "Sorry, login name must contain alphanumeric characters only.\n"
-       if ($login_name !~ /^[a-zA-Z0-9_]\w*$/);
+       if ($login_name !~ /^[a-zA-Z0-9_][a-zA-Z0-9_\-]*$/);
 } else {
     if ($affirm) {
        print STDERR "${whoami}: Error: -y option given without username!\n";


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: dougb 
State-Changed-When: Thu Nov 2 00:19:35 PST 2000 
State-Changed-Why:  
Patch committed to -current, will MFC after the freeze. 
After long discussion it was decided that rmuser should 
be able to delete any user currently in the password 
database. Using getpwnam() allows us to determine 
whether the user is present, and get their data 
faster.  


Responsible-Changed-From-To: freebsd-bugs->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Thu Nov 2 00:19:35 PST 2000 
Responsible-Changed-Why:  
I'm taking responsibility for this PR 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22278 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dougb 
State-Changed-When: Sun Jan 14 02:34:08 PST 2001 
State-Changed-Why:  

A fix for this problem has been committed to -current 
and -stable. Thanks. :) 

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