From e438455e0f86662e904e9f845c9097f45185af46 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Thu, 24 Jan 2019 08:48:22 +0100 Subject: [PATCH] d/postfwd.postrm: detect existens of command by which and not 'test -x' --- debian/postfwd.postrm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/debian/postfwd.postrm b/debian/postfwd.postrm index eb50815..5c1cb0e 100644 --- a/debian/postfwd.postrm +++ b/debian/postfwd.postrm @@ -27,14 +27,17 @@ case "$1" in if USERID=`getent passwd $NUSER | cut -f 3 -d ':'`; then if [ -n "$USERID" ]; then if [ "$FIST_SYSTEM_UID" -le "$USERID" ] && \ - [ "$USERID" -le "$LAST_SYSTEM_UID" ] && \ - [ -x /usr/sbin/deluser ]; then + [ "$USERID" -le "$LAST_SYSTEM_UID" ]; then + if which deluser > /dev/null; then deluser --quiet $NUSER || true # And then remove the group GROUPID=`getent group $NGROUP | cut -f 3 -d ':'` - if [ -n "$GROUPID" ] && [ -x /usr/sbin/delgroup ] ; then - delgroup --quiet $NGROUP || true + if [ -n "$GROUPID" ]; then + if which delgroup > /dev/null; then + delgroup --quiet $NGROUP || true + fi fi + fi fi fi fi