From 4e87160dec219511e24252efbb87e25e613375d7 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 22 Mar 2009 03:57:14 +0100 Subject: [PATCH] dbus: (INSTALL) also run getent via chroot. --HG-- extra : convert_revision : 201163531cb8e1ecca7b974ab2654717755fb669 --- templates/dbus/INSTALL | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/dbus/INSTALL b/templates/dbus/INSTALL index ecc7b58e3f0..19d01438d16 100644 --- a/templates/dbus/INSTALL +++ b/templates/dbus/INSTALL @@ -9,16 +9,18 @@ pre) ;; post) echo "Running $3-$4 post installation hooks..." - if getent group dbus >/dev/null; then + if ! chroot . getent group dbus >/dev/null; then chroot . groupadd -r dbus - [ $? -eq 0 ] && echo "Created dbus system group." + [ $? -ne 0 ] && exit $? + echo "Created dbus system group." fi - if getent passwd dbus >/dev/null; then + if ! chroot . getent passwd dbus >/dev/null; then chroot . useradd -c "System message bus" \ -d /var/run/dbus \ -s /sbin/nologin -g dbus -r dbus && \ chroot . passwd -l dbus &>/dev/null - [ $? -eq 0 ] && echo "Created dbus system user." + [ $? -ne 0 ] && exit $? + echo "Created dbus system user." fi chroot . chown root:dbus ${dbus_launch} chroot . chmod 4750 ${dbus_launch}