hal/tools hal-system-storage-unmount,1.5,1.6

David Zeuthen david at freedesktop.org
Sun Feb 12 13:47:30 PST 2006


Update of /cvs/hal/hal/tools
In directory gabe:/tmp/cvs-serv15287/tools

Modified Files:
	hal-system-storage-unmount 
Log Message:
2006-02-12  David Zeuthen  <davidz at redhat.com>

        * tools/hal-system-storage-unmount (MOUNT_POINT): Attempt to use
        volume.mount_point if we cannot find
        info.hal_mount.created_mount_point

        * libhal/libhal.h: Export prototype for new function
        libhal_ctx_get_dbus_connection()

        * libhal/libhal.c (libhal_ctx_get_dbus_connection): New function

        * hald/linux2/addons/addon-storage.c (force_unmount): Use a the
        Unmount() hal method to lazy unmount

        * hald/linux2/osspec.c (hald_udev_data): Ugh ugh ugh.. clear
        buffer before receiving data from udev.. we didn't use to do this
        and we got all sorts of weird side-effects since we'd for instance
        pick up DEVNAME='/dev/sdb' and _then_ DEVNAME='/dev/sda1' for
        /sys/block/sdb.. This was because this data was left in the buffer
        from the old run. It now appears to work..

        * hald/linux2/blockdev.c (force_unmount_cb): New function, pass
        end_token to hal_util_callout_device_remove()
        (force_unmount): Use the Unmount method call to lazy unmount, thus
        making sure we don't block
        (hotplug_event_begin_remove_blockdev): Pass end_token to force_unmount
        and let that function invoke hal_util_callout_device_remove()

        * hald/hald_dbus.c (hald_exec_method_cb, hald_exec_method): Make
        this work for helpers using a direct connection to hald
        (hald_dbus_filter_handle_methods): Pass local_interface to
        hald_exec_method

        * hald/valgrind-hald.sh, /debug-hald.sh: Update to use 'pwd' just
        like run-hald.sh was updated



Index: hal-system-storage-unmount
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-storage-unmount,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- hal-system-storage-unmount	10 Feb 2006 02:40:01 -0000	1.5
+++ hal-system-storage-unmount	12 Feb 2006 21:47:28 -0000	1.6
@@ -15,9 +15,12 @@
 
 MOUNT_POINT="$HAL_PROP_INFO_HAL_MOUNT_CREATED_MOUNT_POINT"
 if [ "$MOUNT_POINT" == "" ]; then
-    echo "org.freedesktop.Hal.Device.Volume.NotMounted" >&2
-    echo "Cannot figure out where device is mounted." >&2
-    exit 1
+    MOUNT_POINT="$HAL_PROP_VOLUME_MOUNT_POINT"
+    if [ "$MOUNT_POINT" == "" ]; then
+	echo "org.freedesktop.Hal.Device.Volume.NotMounted" >&2
+	echo "Cannot figure out where device is mounted." >&2
+	exit 1
+    fi
 fi
 
 if [ "$HAL_PROP_STORAGE_MEDIA_CHECK_ENABLED" != "false" ]; then
@@ -30,8 +33,12 @@
 
 if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ]; then
     if [ "$HAL_METHOD_INVOKED_BY_UID" != "$HAL_PROP_INFO_HAL_MOUNT_MOUNTED_BY_UID" ]; then
+	UID_MOUNTED="$HAL_PROP_INFO_HAL_MOUNT_MOUNTED_BY_UID"
+	if [ "$UID_MOUNTED" == "" ]; then
+	    UID_MOUNTED="UNKNOWN"
+	fi
 	echo "org.freedesktop.Hal.Device.Volume.PermissionDenied" >&2
-	echo "Volume mounted by uid $HAL_PROP_INFO_HAL_MOUNT_MOUNTED_BY_UID cannot be unmounted by uid $HAL_METHOD_INVOKED_BY_UID." >&2
+	echo "Volume mounted by uid $UID_MOUNTED cannot be unmounted by uid $HAL_METHOD_INVOKED_BY_UID." >&2
 	exit 1
     fi
 fi




More information about the hal-commit mailing list