Skip to content

Commit

Permalink
sysusers.sh: Create /etc/login.defs if missing
Browse files Browse the repository at this point in the history
useradd needs both /etc/group and /etc/login.defs to work. It does
chroot into a new system and then looks for these files. While this is
technically correct it is a bit inconvenient for RPM. Creating
etc/login.defs as an empty file make this work but still runs useradd
without  proper configuration until the shadow-utils package gets
installed. There isn't really anything RPM can do about that and
distribution need to ahndle the situation to make installations to an
empty directory with rpm --roo work.

Resolves: rpm-software-management#3186
  • Loading branch information
ffesti committed Jul 15, 2024
1 parent 184475d commit ccb6125
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/sysusers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ mkdir -p "$ROOT"/etc/
[ -e "$ROOT"/etc/passwd ] || touch "$ROOT"/etc/passwd
[ -e "$ROOT"/etc/shadow ] || touch "$ROOT"/etc/shadow
[ -e "$ROOT"/etc/group ] || touch "$ROOT"/etc/group
[ -e "$ROOT"/etc/login.defs ] || touch "$ROOT"/etc/login.defs

# read files from command line
for fn in "$@"; do
Expand Down

0 comments on commit ccb6125

Please sign in to comment.