HomeFreeBSD

pw: Ensure group membership is not duplicated

Description

pw: Ensure group membership is not duplicated

Fix the following problem:

  1. A nonexistent user, someuser, is added to somegroup in /etc/group.
  2. someuser is then created with membership in somegroup.

The entry for somegroup in /etc/group will then contain

somegroup:*:12345:someuser,someuser

With this fix, the entry will be

somegroup:*:12345:someuser

PR: 238995
Reviewed by: bapt, jrm
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41076

(cherry picked from commit 17839f45d86e79065a65ad3e2522dd69b29a652c)

Details

Provenance
mail_nsood.inAuthored on Jul 19 2023, 12:44 PM
desCommitted on May 9 2024, 11:04 AM
Reviewer
bapt
Differential Revision
D41076: pw: check for user in group entry before adding them
Parents
rGe5e6242f62a3: lib/clang: clean out old llvm/clang Sparc target remnants
Branches
Unknown
Tags
Unknown