[Pkg-utopia-commits] r1812 - in /packages/unstable/hal/debian: changelog patches/55_nonpolkit-mount-policy.patch

biebl at users.alioth.debian.org biebl at users.alioth.debian.org
Mon Oct 22 12:23:31 UTC 2007


Author: biebl
Date: Mon Oct 22 12:23:31 2007
New Revision: 1812

URL: http://svn.debian.org/wsvn/pkg-utopia/?sc=1&rev=1812
Log:
    hal-setup-keymap binary that is necessary for the multimedia key
* debian/patches/55_nonpolkit-mount-policy.patch
  - Rework patch for this hal version. Throw a Volume.PermissionDenied error
    if a non-removable device is mounted by a user other than root. 

Modified:
    packages/unstable/hal/debian/changelog
    packages/unstable/hal/debian/patches/55_nonpolkit-mount-policy.patch

Modified: packages/unstable/hal/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/hal/debian/changelog?rev=1812&op=diff
==============================================================================
--- packages/unstable/hal/debian/changelog (original)
+++ packages/unstable/hal/debian/changelog Mon Oct 22 12:23:31 2007
@@ -25,7 +25,7 @@
     - Replace Suggests: hal-device-manager with gnome-device-manager.
     - Use the new "Homepage:" field to specify the upstream URL.
     - Add a Build-Depends: gperf. This utility is required for building the
-      hal-setup-keymap binary that is necessary for the multimedia key 
+      hal-setup-keymap binary that is necessary for the multimedia key
       re-mapping support.
     - Add a Recommends: libsmbios-bin [i386 amd64]. The libsmbios-bin
       package ships the dellWirelessCtl utility which is required for the
@@ -48,6 +48,9 @@
     debian/patches/14_power_suspend_linux_pmu_fix.patch
     - As we only support pm-utils, these patches have become obsolete and are
       thus removed.
+  * debian/patches/55_nonpolkit-mount-policy.patch
+    - Rework patch for this hal version. Throw a Volume.PermissionDenied error
+      if a non-removable device is mounted by a user other than root. 
 
   [ Sebastian Dröge ]
   * debian/patches/68_alternative-cdrw-capacity-detection.patch
@@ -55,7 +58,8 @@
       Only using the old method fails for some drives, for more information
       see http://bugs.freedesktop.org/show_bug.cgi?id=12822 .
 
- -- Michael Biebl <biebl at debian.org>  Mon, 22 Oct 2007 11:11:12 +0200
+
+ -- Michael Biebl <biebl at debian.org>  Mon, 22 Oct 2007 14:11:31 +0200
 
 hal (0.5.9.1-6) unstable; urgency=low
 

Modified: packages/unstable/hal/debian/patches/55_nonpolkit-mount-policy.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/hal/debian/patches/55_nonpolkit-mount-policy.patch?rev=1812&op=diff
==============================================================================
--- packages/unstable/hal/debian/patches/55_nonpolkit-mount-policy.patch (original)
+++ packages/unstable/hal/debian/patches/55_nonpolkit-mount-policy.patch Mon Oct 22 12:23:31 2007
@@ -1,32 +1,33 @@
-diff -Nur hal-0.5.9/tools/hal-storage-mount.c hal-0.5.9.new/tools/hal-storage-mount.c
---- hal-0.5.9/tools/hal-storage-mount.c	2007-04-17 20:36:35.000000000 +0200
-+++ hal-0.5.9.new/tools/hal-storage-mount.c	2007-04-17 20:38:34.000000000 +0200
-@@ -143,7 +143,6 @@
- 	exit (1);
+diff --git a/tools/hal-storage-mount.c b/tools/hal-storage-mount.c
+index ae14181..4628067 100644
+--- a/tools/hal-storage-mount.c
++++ b/tools/hal-storage-mount.c
+@@ -92,6 +92,14 @@ permission_denied_etc_fstab (const char *device)
  }
  
--#ifdef HAVE_POLKIT
  static void
- permission_denied_privilege (const char *privilege, const char *uid)
++permission_denied_uid (const char *device, const char *uid)
++{
++	fprintf (stderr, "org.freedesktop.Hal.Device.Volume.PermissionDenied\n");
++	fprintf (stderr, "Refusing to mount device %s for uid=%s.\n", device, uid);
++	exit (1);
++}
++
++static void
+ already_mounted (const char *device)
  {
-@@ -151,7 +150,6 @@
- 	fprintf (stderr, "%s refused uid %s\n", privilege, uid);
- 	exit (1);
- }
--#endif
- 
- /* borrowed from gtk/gtkfilesystemunix.c in GTK+ on 02/23/2006 */
- static void
-@@ -776,6 +774,12 @@
-                         permission_denied_privilege (privilege, invoked_by_uid);
+ 	fprintf (stderr, "org.freedesktop.Hal.Device.Volume.AlreadyMounted\n");
+@@ -812,6 +820,13 @@ handle_mount (LibHalContext *hal_ctx,
                  }
+                 libhal_free_string (polkit_result);
          }
 +#else
-+        /* root can do everything; only allow handling removable devices
-+         * without uid change to non-root users */
-+        if (!invoked_by_uid || strcmp(invoked_by_uid, "0"))
-+                if (!privilege || strcmp (privilege, "hal-storage-removable-mount"))
-+                        permission_denied_privilege (privilege, invoked_by_uid);
++	/* root can do everything; only allow handling removable devices
++	 * without uid change to non-root users */
++	if (!invoked_by_uid || strcmp(invoked_by_uid, "0"))
++		if (!action || strcmp (action, "org.freedesktop.hal.storage.mount-removable"))
++			permission_denied_uid (device, invoked_by_uid);
++
  #endif
  
  #ifdef DEBUG




More information about the Pkg-utopia-commits mailing list