Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Aug 2004 23:38:04 GMT
From:      Brad Killebrew <brad@txic.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:    bin/70283: adduser aborts in batch mode with comments or blank lines
Message-ID:  <200408102338.i7ANc4CH074173@www.freebsd.org>
Resent-Message-ID: <200408102340.i7ANePDA090096@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         70283
>Category:       bin
>Synopsis:       adduser aborts in batch mode with comments or blank lines
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 10 23:40:25 GMT 2004
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408102338.i7ANc4CH074173>