hal/tools/linux hal-system-storage-eject-linux, 1.1, 1.2 hal-system-storage-unmount-linux, 1.1, 1.2

Danny Kukawka dkukawka at kemper.freedesktop.org
Wed May 17 13:12:19 PDT 2006


Update of /cvs/hal/hal/tools/linux
In directory kemper:/tmp/cvs-serv2169/tools/linux

Modified Files:
	hal-system-storage-eject-linux 
	hal-system-storage-unmount-linux 
Log Message:
2006-05-17  Danny Kukawka  <danny.kukawka at web.de>

        Fixed path to the helper of the related backends, added several
        messages as e.g. UnknownError if backend not found (William Jon
        McCann <mccann at jhu.edu>) and if a needed environment variable is
        not set. Capture result of command polkit-is-privileged (William i
        Jon McCann <mccann at jhu.edu>)

        * hald/hald_runner.c: (hald_runner_start_runner): added
        PACKAGE_BIN_DIR to PATH
        * tools/hal-luks-remove:
        * tools/hal-luks-remove.in:
        * tools/hal-luks-setup:
        * tools/hal-luks-teardown:
        * tools/hal-system-lcd-get-brightness:
        * tools/hal-system-lcd-set-brightness:
        * tools/hal-system-power-hibernate:
        * tools/hal-system-power-reboot:
        * tools/hal-system-power-set-power-save:
        * tools/hal-system-power-shutdown:
        * tools/hal-system-power-suspend:
        * tools/hal-system-storage-cleanup-mountpoint:
        * tools/hal-system-storage-cleanup-mountpoints:
        * tools/hal-system-storage-eject:
        * tools/hal-system-storage-unmount: export MOUNT_POINT for the
        backend script William Jon McCann <mccann at jhu.edu>
        * tools/linux/hal-system-storage-eject-linux: added result of failed
        eject to error message (<mccann at jhu.edu>), added GIVEN_EJECTOPTIONS
        to the eject command
        * tools/linux/hal-system-storage-unmount-linux:



Index: hal-system-storage-eject-linux
===================================================================
RCS file: /cvs/hal/hal/tools/linux/hal-system-storage-eject-linux,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- hal-system-storage-eject-linux	14 May 2006 18:49:53 -0000	1.1
+++ hal-system-storage-eject-linux	17 May 2006 20:12:17 -0000	1.2
@@ -12,10 +12,10 @@
 # Only allow ^a-zA-Z0-9_= in the string because otherwise someone may
 # pass e.g. umask=0600,suid,dev or umask=`/bin/evil`
 
-rc=0
 read GIVEN_EJECTOPTIONS
 GIVEN_EJECTOPTIONS="`echo \"$GIVEN_EJECTOPTIONS\" | tr -cd \"a-zA-Z0-9_=[:space:]\"`"
-RESULT=$(eject "$HAL_PROP_BLOCK_DEVICE" 2>&1)
+
+RESULT=$(eject $GIVEN_EJECTOPTIONS "$HAL_PROP_BLOCK_DEVICE" 2>&1)
 
 if [ $? -ne 0 ]; then
     case "$RESULT" in
@@ -25,7 +25,7 @@
 	    ;;
 	*)
 	    echo "org.freedesktop.Hal.Device.Volume.UnknownFailure" >&2
-	    echo "Unknown failure." >&2
+	    echo "Unknown failure: $RESULT" >&2
     esac
     exit 1
 fi

Index: hal-system-storage-unmount-linux
===================================================================
RCS file: /cvs/hal/hal/tools/linux/hal-system-storage-unmount-linux,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- hal-system-storage-unmount-linux	14 May 2006 18:49:53 -0000	1.1
+++ hal-system-storage-unmount-linux	17 May 2006 20:12:17 -0000	1.2
@@ -14,6 +14,12 @@
 read GIVEN_UNMOUNTOPTIONS
 GIVEN_UNMOUNTOPTIONS="`echo \"$GIVEN_UNMOUNTOPTIONS\" | tr -cd \"a-zA-Z0-9_=[:space:]\"`"
 
+if [ -z "$MOUNT_POINT" ]; then
+	echo "org.freedesktop.Hal.Device.Volume.UnknownMountpoint" >&2
+	echo "Missing mountpoint, cannot figure out where device is mounted." >&2
+	exit 1
+fi
+
 if [ -n "$GIVEN_UNMOUNTOPTIONS" ]; then
     for OPTION in $GIVEN_UNMOUNTOPTIONS; do
 	OPTION_WAS_OK="0"
@@ -60,7 +66,7 @@
 	    ;;
 	*)
 	    echo "org.freedesktop.Hal.Device.Volume.UnknownFailure" >&2
-	    echo "Unknown failure." >&2
+	    echo "Unknown failure: $RESULT" >&2
     esac
     exit 1
 fi




More information about the hal-commit mailing list