xbps-triggers: system-accounts: accept acct:uid.
This commit is contained in:
parent
469e290c28
commit
ee8504eeae
|
@ -83,6 +83,10 @@ run)
|
|||
|
||||
# System user/group required by a package.
|
||||
for acct in ${system_accounts}; do
|
||||
_uname="${acct%:*}"
|
||||
_uid="${acct#*:}"
|
||||
[ "${_uid}" != "${_uname}" ] && use_id="-r ${_uid}"
|
||||
|
||||
if [ ! -x "$USERADD" ]; then
|
||||
echo "WARNING: cannot create ${acct} system user/group (missing useradd)"
|
||||
continue
|
||||
|
@ -99,9 +103,9 @@ run)
|
|||
group_add $acct
|
||||
|
||||
if ! $GETENT passwd ${acct} >/dev/null; then
|
||||
$USERADD -c "$descr" -d "$homedir" \
|
||||
-s "$shell" -g ${acct} $user_groups \
|
||||
-r ${acct} && \
|
||||
$USERADD -c "$descr" -d "$homedir" ${use_id} \
|
||||
-s "$shell" -g ${_uname} $user_groups \
|
||||
-r ${_uname} && \
|
||||
$PASSWD -l ${acct} >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Created ${acct} system user."
|
||||
|
@ -118,11 +122,13 @@ run)
|
|||
#
|
||||
if [ "$UPDATE" = "no" ]; then
|
||||
for acct in ${system_accounts}; do
|
||||
_uname="${acct%:*}"
|
||||
_uid="${acct#*:}"
|
||||
if [ ! -x "$USERDEL" ]; then
|
||||
echo "WARNING: cannot remove ${acct} system user/group (missing userdel)"
|
||||
continue
|
||||
fi
|
||||
$USERDEL ${acct} >/dev/null 2>&1
|
||||
$USERDEL ${_uname} >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Removed ${acct} system user/group."
|
||||
fi
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Template file for 'xbps-triggers'
|
||||
pkgname=xbps-triggers
|
||||
version=0.80
|
||||
version=0.81
|
||||
revision=1
|
||||
noarch=yes
|
||||
bootstrap=yes
|
||||
|
|
Loading…
Reference in New Issue