[Bug 238995] adduser does not check for pre-existing user field entries in /etc/group

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jul 4 19:29:25 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238995

            Bug ID: 238995
           Summary: adduser does not check for pre-existing user field
                    entries in /etc/group
           Product: Base System
           Version: 12.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: dclarke at blastwave.org

Seems minor but merely annoying. One may edit /etc/group before running
adduser and put in the future username for some group.  Seems trivial.

vesta# uname -a 
FreeBSD vesta 12.0-RELEASE-p4 FreeBSD 12.0-RELEASE-p4 GENERIC  amd64

Toss a group into /etc/group :

vesta# /usr/bin/printf "foo:*:12345:someuser\n" >> /etc/group
vesta# grep 'foo' /etc/group
foo:*:12345:someuser
vesta# 

Now run adduser and toss a new user into the system with that group
as a part of the creation process : 

vesta# adduser
Username: someuser
Full name: Some Test User
Uid (Leave empty for default): 54321
Login group [someuser]: 
Login group is someuser. Invite someuser into other groups? []: foo
Login class [default]: 
Shell (sh csh tcsh bash rbash git-shell nologin) [sh]: 
Home directory [/home/someuser]: 
Home directory permissions (Leave empty for default): 
Use password-based authentication? [yes]: 
Use an empty password? (yes/no) [no]: 
Use a random password? (yes/no) [no]: 
Enter password: 
Enter password again: 
Lock out the account after creation? [no]: 
Username   : someuser
Password   : *****
Full Name  : Some Test User
Uid        : 54321
Class      : 
Groups     : someuser foo
Home       : /home/someuser
Home Mode  : 
Shell      : /bin/sh
Locked     : no
OK? (yes/no): yes
adduser: INFO: Successfully added (someuser) to the user database.
Add another user? (yes/no): no
Goodbye!
vesta# 

Here adduser duplicates the entry for the group 'foo' : 

vesta# grep 'foo' /etc/group
foo:*:12345:someuser,someuser
vesta# 

Seems trivial and slightly annoying.

-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list