xbps-triggers: set homedir of disabled accounts to /var/empty

This commit is contained in:
Cameron Nemo 2018-11-23 22:20:41 -08:00 committed by maxice8
parent 4979ea9237
commit 5abdf75173
3 changed files with 11 additions and 9 deletions

View File

@ -1719,8 +1719,9 @@ anything unless it is defined.
The system-accounts trigger is responsible for creating and disabling system accounts
and groups.
During removal it will disable the account by setting the Shell to /bin/false and appending
' - for uninstalled package $pkgname' to the Description.
During removal it will disable the account by setting the Shell to /bin/false,
Home to /var/empty, and appending ' - for uninstalled package $pkgname' to the
Description.
Example: `transmission unprivileged user - for uninstalled package transmission`
This trigger can only be used by using the `system_accounts` variable.

View File

@ -122,11 +122,12 @@ run)
echo "WARNING: cannot update ${acct} system user/group (missing usermod)"
continue
fi
usermod -c "${descr}" -s "${shell}" ${_uname} >/dev/null 2>&1
usermod -c "${descr}" -d "${homedir}" -s "${shell}" ${user_groups} \
-g "${pgroup:-${_uname}}" ${_uname} >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Updated shell and comment for ${_uname} (${_uid}) system user."
echo "Updated ${_uname} (${_uid}) system user."
else
echo "Failed to update shell and comment for ${acct} system user!"
echo "Failed to update ${acct} system user!"
exit 1
fi
fi
@ -142,7 +143,7 @@ run)
echo "WARNING: cannot disable ${acct} system user/group (missing usermod)"
continue
fi
usermod -L -s /bin/false -c "${comment}" ${_uname} >/dev/null 2>&1
usermod -L -d /var/empty -s /bin/false -c "${comment}" ${_uname} >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Disabled ${_uname} (${_uid}) system user/group."
fi

View File

@ -1,13 +1,13 @@
# Template file for 'xbps-triggers'
pkgname=xbps-triggers
version=0.110
version=0.111
revision=1
noarch=yes
bootstrap=yes
short_desc="The XBPS triggers for Void Linux"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://www.voidlinux.eu"
license="Simplified BSD"
homepage="https://voidlinux.org"
license="BSD-2-clause"
do_install() {
_triggersdir=usr/libexec/${pkgname}