xbps-triggers: repair the system-accounts trigger (oops)

This commit is contained in:
Juan RP 2014-10-01 16:36:02 +02:00
parent 3bd3ccd7dd
commit 74cc911e3b
2 changed files with 8 additions and 6 deletions

12
srcpkgs/xbps-triggers/files/system-accounts Executable file → Normal file
View File

@ -60,9 +60,12 @@ run)
if [ -x sbin/groupdel ]; then
GROUPDEL=1
fi
if [ -x sbin/getent ]; then
if [ -x bin/getent -o -x sbin/getent ]; then
GETENT=1
fi
if [ -x bin/passwd -o -x sbin/passwd ]; then
PASSWD=1
fi
case "$TARGET" in
post-install)
@ -91,8 +94,8 @@ run)
[ -z "$descr" ] && descr="${_uname} unprivileged user"
[ -n "$groups" ] && user_groups="-G $groups"
if [ -z "$USERADD" -a -z "$GETENT" ]; then
echo "WARNING: cannot create ${acct} system user/group (missing useradd/getent)"
if [ -z "$USERADD" -a -z "$GETENT" -a -z "$PASSWD" ]; then
echo "WARNING: cannot create ${acct} system user/group (missing useradd/getent/passwd)"
echo "The following system account must be created:"
echo " Account: ${uname:-${_uid}} (uid: '${_uid}')"
echo " Description: '${descr}'"
@ -107,7 +110,7 @@ run)
if ! getent passwd ${_uname} >/dev/null; then
useradd -c "$descr" -d "$homedir" -s "$shell" \
${user_groups} ${use_id:=-g ${_uname}} -r ${_uname} && \
$PASSWD -l ${_uname} >/dev/null 2>&1
passwd -l ${_uname} >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Created ${_uname} (${_uid}) system user."
else
@ -156,4 +159,3 @@ run)
esac
exit 0
# end

View File

@ -1,6 +1,6 @@
# Template file for 'xbps-triggers'
pkgname=xbps-triggers
version=0.87
version=0.88
revision=1
noarch=yes
bootstrap=yes