mirror of
https://github.com/navidrome/navidrome.git
synced 2026-12-05 03:07:25 +00:00
useradd --create-home copies /etc/skel as useradd_t, and SELinux denies file creation on the var_lib_t target, so installing the RPM on an enforcing distro logs an AVC for .bash_logout (and the file never lands). Use --no-create-home and create /var/lib/navidrome with install -d in the scriptlet context instead. The home dir no longer receives skel files, which are useless for a system service account. Fixes #6360 Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
11 lines
495 B
Bash
Executable File
11 lines
495 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if ! getent passwd navidrome > /dev/null 2>&1; then
|
|
printf "Creating default Navidrome user\n"
|
|
# SELinux denies useradd's /etc/skel copy into /var/lib (var_lib_t), so
|
|
# --create-home logs an AVC on enforcing distros. Create the dir ourselves,
|
|
# with the same 0700 mode useradd --create-home would have set.
|
|
useradd --home-dir /var/lib/navidrome --no-create-home --system --user-group navidrome
|
|
install -d -m 700 -o navidrome -g navidrome /var/lib/navidrome
|
|
fi
|