From 74cc911e3b11da33a4b07ba17c45a296e0bc08fb Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 1 Oct 2014 16:36:02 +0200 Subject: [PATCH] xbps-triggers: repair the system-accounts trigger (oops) --- srcpkgs/xbps-triggers/files/system-accounts | 12 +++++++----- srcpkgs/xbps-triggers/template | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) mode change 100755 => 100644 srcpkgs/xbps-triggers/files/system-accounts diff --git a/srcpkgs/xbps-triggers/files/system-accounts b/srcpkgs/xbps-triggers/files/system-accounts old mode 100755 new mode 100644 index bb01510c50c..e41ce37fe80 --- a/srcpkgs/xbps-triggers/files/system-accounts +++ b/srcpkgs/xbps-triggers/files/system-accounts @@ -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 diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template index 46a9b906118..3b8ac190023 100644 --- a/srcpkgs/xbps-triggers/template +++ b/srcpkgs/xbps-triggers/template @@ -1,6 +1,6 @@ # Template file for 'xbps-triggers' pkgname=xbps-triggers -version=0.87 +version=0.88 revision=1 noarch=yes bootstrap=yes