From nobody@FreeBSD.org  Tue Aug 10 23:38:04 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BA53216A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 10 Aug 2004 23:38:04 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B362443D2D
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 10 Aug 2004 23:38:04 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i7ANc4xq074174
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 10 Aug 2004 23:38:04 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i7ANc4CH074173;
	Tue, 10 Aug 2004 23:38:04 GMT
	(envelope-from nobody)
Message-Id: <200408102338.i7ANc4CH074173@www.freebsd.org>
Date: Tue, 10 Aug 2004 23:38:04 GMT
From: Brad Killebrew <brad@txic.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: adduser aborts in batch mode with comments or blank lines
X-Send-Pr-Version: www-2.3

>Number:         70283
>Category:       bin
>Synopsis:       adduser aborts in batch mode with comments or blank lines
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mtm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 10 23:40:25 GMT 2004
>Closed-Date:    Tue Oct 02 00:21:27 GMT 2007
>Last-Modified:  Tue Oct 02 00:21:27 GMT 2007
>Originator:     Brad Killebrew
>Release:        5.2.1-RELEASE-p9
>Organization:
TXIC
>Environment:
FreeBSD mail.nwwomens.com 5.2.1-RELEASE-p9 FreeBSD 5.2.1-RELEASE-p9 #0: Tue Aug 10 13:50:23 CDT 2004     root@mail.nwwomens.com:/usr/obj/usr/src/sys/NWW  i386

>Description:
When used with the -f option (batch mode), the adduser script aborts when encountering a comment or blank line. This problem is exhibited in the following version.  I have not tested other versions.

$FreeBSD: src/usr.sbin/adduser/adduser.sh,v 1.20 2003/06/24 15:20:43 mtm Exp $
>How-To-Repeat:
adduser -f <batchfile>

Where <batchfile> contains multiple accounts to be created and also contains comments and/or blank lines.
>Fix:
This is corrected by changing a return to a continue in a case/esac statement.  Unified diff follows.

--- /usr/src/usr.sbin/adduser/adduser.sh        Tue Jun 24 10:20:43 2003
+++ /usr/sbin/adduser   Tue Aug 10 18:16:32 2004
@@ -563,7 +563,7 @@
        while read -r fileline ; do
                case "$fileline" in
                \#*|'')
-                       return 0
+                        continue
                        ;;
                esac

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mtm 
Responsible-Changed-By: simon 
Responsible-Changed-When: Wed Aug 11 09:04:56 GMT 2004 
Responsible-Changed-Why:  
Over to adduser.sh author for evaluation. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=70283 
State-Changed-From-To: open->patched 
State-Changed-By: linimon 
State-Changed-When: Mon Jun 11 00:38:18 UTC 2007 
State-Changed-Why:  
Although this patch was not adopted, a similar one was in 1.26, and then 
fixed in 1.29.  In fact, it seems as though 1.27 through 1.30 inclusive 
all need MFCs.  Set this PR to 'patched' as a reminder. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=70283 
State-Changed-From-To: patched->closed 
State-Changed-By: mtm 
State-Changed-When: Tue Oct 2 00:20:08 UTC 2007 
State-Changed-Why:  
MFC'ed to RELENG_6 on 2007/05/16 rev. 1.26.2.3 

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