[Pkg-utopia-commits] r147 - packages/hal/trunk/debian

Sjoerd Simons sjoerd@haydn.debian.org
Wed, 22 Dec 2004 14:32:02 -0700


Author: sjoerd
Date: 2004-12-22 14:30:45 -0700 (Wed, 22 Dec 2004)
New Revision: 147

Modified:
   packages/hal/trunk/debian/changelog
   packages/hal/trunk/debian/hal.postinst
Log:
Only add hal to groups when creating the hal user

Modified: packages/hal/trunk/debian/changelog
===================================================================
--- packages/hal/trunk/debian/changelog	2004-12-22 20:53:21 UTC (rev 146)
+++ packages/hal/trunk/debian/changelog	2004-12-22 21:30:45 UTC (rev 147)
@@ -1,3 +1,10 @@
+hal (0.4.2-4) unstable; urgency=low
+
+  * Only add hal to group cdrom and floppy when creating the user. This way it
+    won't get added on upgrade if the admin removed it. (Closes: #286790)
+
+ -- Sjoerd Simons <sjoerd@debian.org>  Sun, 19 Dec 2004 20:42:37 +0100
+
 hal (0.4.2-3) unstable; urgency=low
 
   * debian/patches/special_mtab_chars.patch

Modified: packages/hal/trunk/debian/hal.postinst
===================================================================
--- packages/hal/trunk/debian/hal.postinst	2004-12-22 20:53:21 UTC (rev 146)
+++ packages/hal/trunk/debian/hal.postinst	2004-12-22 21:30:45 UTC (rev 147)
@@ -43,26 +43,28 @@
 
 case "$1" in
   configure)
-    adduser --quiet --system --home /var/run/hal \
-      --gecos "Hardware abstraction layer" --group hal
+    if ! getent passwd hal >/dev/null; then 
+      adduser --quiet --system --home /var/run/hal \
+        --gecos "Hardware abstraction layer" --group hal
+      # be sure that hal has access to cdrom and floppy devices.
+      adduser --quiet hal floppy
+      adduser --quiet hal cdrom
+    fi
     # be sure the run dir is owned by the hal user
     chown hal.hal /var/run/hal 2>/dev/null || true
-    # be sure that hal has access to cdrom and floppy devices.
-    adduser --quiet hal floppy
-    adduser --quiet hal cdrom
 
     if [ -f /etc/init.d/hal ]; then
       # handle upgrades
       mv /etc/init.d/hal /etc/dbus-1/event.d/
       update-rc.d hal remove
     fi
-   if [ -x ${UDEVSEND} ] ; then
-     do_udev;
-   fi
+    if [ -x ${UDEVSEND} ] ; then
+      do_udev;
+    fi
 
-   if [ -x /etc/init.d/dbus-1 ]; then
-     invoke-rc.d dbus-1 restart || true
-   fi
+    if [ -x /etc/init.d/dbus-1 ]; then
+      invoke-rc.d dbus-1 restart || true
+    fi
   ;;
   abort-upgrade|abort-remove|abort-deconfigure)
   ;;