Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sfos: packaging: Update system-wide user and group creation.
Have static uid and gid for pulse and use only audio as additional
group for user pulse. Fixes JB#46368
  • Loading branch information
jusa committed Jun 20, 2019
1 parent ef9880b commit cdf2790
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions rpm/pulseaudio.spec
Expand Up @@ -149,15 +149,16 @@ install -m0644 README %{buildroot}%{_docdir}/%{name}-%{version}
%fdupes %{buildroot}/%{_includedir}

%pre
# system-wide mode needs an user and two groups
if ! getent passwd pulse > /dev/null ; then
useradd -rUG audio,bluetooth -d /run/pulse -s /sbin/nologin pulse || :
fi
if ! getent group pulse-access > /dev/null ; then
groupadd -rf pulse-access || :
usermod -G pulse-access -a root || :
usermod -G pulse-access -a nemo || :
getent group pulse-access >/dev/null || groupadd -r pulse-access
getent group pulse >/dev/null || groupadd -f -g 171 -r pulse
if ! getent passwd pulse >/dev/null ; then
if ! getent passwd 171 >/dev/null ; then
useradd -r -u 171 -g pulse -G audio -d %{_localstatedir}/run/pulse -s /sbin/nologin -c "PulseAudio System Daemon" pulse
else
useradd -r -g pulse -G audio -d %{_localstatedir}/run/pulse -s /sbin/nologin -c "PulseAudio System Daemon" pulse
fi
fi
usermod -G pulse-access -a root || :

%post -p /sbin/ldconfig

Expand Down

0 comments on commit cdf2790

Please sign in to comment.