From nobody Wed Jul 19 13:57:17 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5cnp1P8Zz4dT1m for ; Wed, 19 Jul 2023 13:57:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5cnn6XvTz4Q9n for ; Wed, 19 Jul 2023 13:57:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689775037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G/09ftGtzInE6PAeKRvqluxNasfVOvkGGiQIdTn7v1k=; b=CBOetuBywYw76YzAzNt68tZkgCfko4q5Pi2dCZm1y9WIfDnlWOGfXHnLlzV8GjDLyIhOeu JBT/kOBYi5DiWZucXVDTfcftVtv/S+lhT2HXb7LgVxmniNS3osqNUtuoDQ6qjQC2S7lM8W vQY/w+GlWMsaOLP4m/r8nJPfLOUkgcxRi24ZFNbFpztVrud5iiPhRCJvk0P0o7ZGLpzIdw vnDJyu7mpCtbdwPf2wsplIEeVzjJUW6A5cLS23jH98rrhy7PPvlAVIqTC+qGSIT/I9iE5U RLYxl4c9MtrsjJt7AoLyggaQD/5HqZ0AiCAk3AK+cvUWvXqpnEunqYngbab74Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689775037; a=rsa-sha256; cv=none; b=gD2/uMzOk19FmGk1RiULPCheDRcfGpJePHXhDI25yz8NuyrN5iEf4qFmFy/r7XWUZIsuMZ Aj+rcYgS60Mtj8DNZ63GLCUjqRTRI4+AK42ZH985X3E6dSPBAx9dHuocFmr15H1GP3M1ip 7E4kW94XuJ+LhnJ+KZCSobiec008iP9TzlPtG1Jk+P4mBD47Ropm47nNrwkbGrQ2Fs5HZk yChxhQWrWogsvbS/BYNgHugO2zr87x8VCHihCCtasq/pWo0FxmO96Nnc0GkbXljAcM1YUn HDe6/IV5ZRqiiZCIO2uwLmF25sIVaQhumzPXVGpltBwZMIm5240lM+R3hlbgtw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5cnn5WvWzqD7 for ; Wed, 19 Jul 2023 13:57:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 36JDvHKs033474 for ; Wed, 19 Jul 2023 13:57:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 36JDvHlf033473 for bugs@FreeBSD.org; Wed, 19 Jul 2023 13:57:17 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f 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 Date: Wed, 19 Jul 2023 13:57:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: naman@freebsdfoundation.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238995 --- Comment #7 from Naman Sood --- Hello! I just finished looking into this, and a few things to note: 1. Your 2023 example is expected behavior - `pw groupshow` will list the gr= oups as in /etc/group, but group(5) notes that "A user is automatically in a gro= up if that group specified in their /etc/passwd entry and does not need to be added that group in the group file." Since in that example, the user riscv's login group was riscv, pw did not add it to the group file. If you'd like to get group membership that keeps such things in mind, `id riscv` shows that. root@neon-testvm:~ # pw groupadd -n testuser -g 4242 root@neon-testvm:~ # adduser Username: testuser Full name:=20 Uid (Leave empty for default): 4242 Login group [testuser]:=20 Login group is testuser. Invite testuser into other groups? []:=20 Login class [default]:=20 Shell (sh csh tcsh nologin) [sh]:=20 Home directory [/home/testuser]:=20 Home directory permissions (Leave empty for default):=20 Use password-based authentication? [yes]: no Lock out the account after creation? [no]:=20 Username : testuser Password : Full Name :=20 Uid : 4242 Class :=20 Groups : testuser=20 Home : /home/testuser Home Mode :=20 Shell : /bin/sh Locked : no OK? (yes/no): yes adduser: INFO: Successfully added (testuser) to the user database. Add another user? (yes/no): no Goodbye! root@neon-testvm:~ # cat /etc/group | grep testuser testuser:*:4242: root@neon-testvm:~ # pw groupshow testuser testuser:*:4242: root@neon-testvm:~ # id testuser uid=3D4242(testuser) gid=3D4242(testuser) groups=3D4242(testuser) The bugs exposed by your 2021 and 2019 examples have been fixed in the comm= its above. --=20 You are receiving this mail because: You are the assignee for the bug.=