Date: Thu, 06 Jul 2023 12:39:52 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 238995] adduser does not check for pre-existing user field entries in /etc/group Message-ID: <bug-238995-227-fWdKDsYR5l@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-238995-227@https.bugs.freebsd.org/bugzilla/> References: <bug-238995-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238995 --- Comment #3 from Dennis Clarke <dclarke@blastwave.org> --- Here in middle of 2023 and adduser and groupmod options to pw seem to be just plain wrong. pluto# uname -apKU FreeBSD pluto 13.2-RELEASE-p1 FreeBSD 13.2-RELEASE-p1 GENERIC amd64 amd64 1302001 1302001 pluto#=20 This is a perfectly stable server that does nothing much but serve NFSv3 as well as iSCSI over 10Gbit links. Runs great. For the sake of experiment I am thinking of planting a QEMU emulation of a RISC-V instance on that very idle server. First I create a group : pluto# pw groupadd -n riscv -g 14142=20 Then add a user : pluto# adduser Username: riscv Full name: qemu rv64imafdc Uid (Leave empty for default): 14142 Login group [riscv]:=20 Login group is riscv. Invite riscv into other groups? []:=20 Login class [default]:=20 Shell (sh csh tcsh nologin) [sh]:=20 Home directory [/home/riscv]:=20 Home directory permissions (Leave empty for default):=20 Use password-based authentication? [yes]:=20 Use an empty password? (yes/no) [no]:=20 Use a random password? (yes/no) [no]:=20 Enter password:=20 Enter password again:=20 Lock out the account after creation? [no]:=20 Username : riscv Password : ***** Full Name : qemu rv64imafdc Uid : 14142 Class :=20 Groups : riscv=20 Home : /home/riscv Home Mode :=20 Shell : /bin/sh Locked : no OK? (yes/no): yes adduser: INFO: Successfully added (riscv) to the user database. Add another user? (yes/no): no Goodbye! pluto#=20 If I look at that group I see that the user does not exist as a member : pluto# pw groupshow -n riscv riscv:*:14142: I have to manually add in the member myself : pluto# pw groupmod -n riscv -g 14142 -m riscv Since I have no reason to trust the pw command I need to verify : pluto# grep 'riscv' /etc/group riscv:*:14142:riscv Seems like broken behavior that is very counterintuitive.=20 related to :=20 pw(8) usermod: numeric ID (uid) in lieu of name for option -n https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269193 pw accepts an "illegal option" but completes the command without error https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263188 Oh joy! bug 263188 seems to have been fixed! --=20 Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-238995-227-fWdKDsYR5l>