hal/tools hal-luks-remove, 1.2, 1.3 hal-luks-remove.in, 1.4, 1.5 hal-luks-setup, 1.5, 1.6 hal-luks-teardown, 1.3, 1.4 hal-system-lcd-get-brightness, 1.10, 1.11 hal-system-lcd-set-brightness, 1.11, 1.12 hal-system-power-hibernate, 1.13, 1.14 hal-system-power-reboot, 1.7, 1.8 hal-system-power-set-power-save, 1.6, 1.7 hal-system-power-shutdown, 1.7, 1.8 hal-system-power-suspend, 1.13, 1.14 hal-system-storage-cleanup-mountpoint, 1.2, 1.3 hal-system-storage-cleanup-mountpoints, 1.4, 1.5 hal-system-storage-eject, 1.11, 1.12 hal-system-storage-unmount, 1.12, 1.13

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


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

Modified Files:
	hal-luks-remove hal-luks-remove.in hal-luks-setup 
	hal-luks-teardown hal-system-lcd-get-brightness 
	hal-system-lcd-set-brightness hal-system-power-hibernate 
	hal-system-power-reboot hal-system-power-set-power-save 
	hal-system-power-shutdown hal-system-power-suspend 
	hal-system-storage-cleanup-mountpoint 
	hal-system-storage-cleanup-mountpoints 
	hal-system-storage-eject hal-system-storage-unmount 
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-luks-remove
===================================================================
RCS file: /cvs/hal/hal/tools/hal-luks-remove,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hal-luks-remove	14 May 2006 18:49:53 -0000	1.2
+++ hal-luks-remove	17 May 2006 20:12:17 -0000	1.3
@@ -7,14 +7,16 @@
 # it under the terms of the GNU General Public License version 2.
 
 if [ -z "$HAL_PROP_BLOCK_DEVICE" ] || [ -z "$HAL_PROP_INFO_UDI" ] || [ -z "$HAL_PROP_VOLUME_UUID" ] ; then
+        echo "org.freedesktop.Hal.Device.UnknownError" >&2
         echo "Missing or empty environment variable(s)." >&2
         echo "This script should be started by hald." >&2
         exit 1
 fi
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-luks-remove.in
===================================================================
RCS file: /cvs/hal/hal/tools/hal-luks-remove.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- hal-luks-remove.in	14 May 2006 18:49:53 -0000	1.4
+++ hal-luks-remove.in	17 May 2006 20:12:17 -0000	1.5
@@ -23,14 +23,16 @@
 
 # Check for environment variables
 if [ -z "$HAL_PROP_BLOCK_DEVICE" ] || [ -z "$HAL_PROP_INFO_UDI" ] || [ -z "$HAL_PROP_VOLUME_UUID" ] ; then
+        echo "org.freedesktop.Hal.Device.UnknownError" >&2
         echo "Missing or empty environment variable(s)." >&2
         echo "This script should be started by hald." >&2
         exit 1
 fi
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-luks-setup
===================================================================
RCS file: /cvs/hal/hal/tools/hal-luks-setup,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- hal-luks-setup	14 May 2006 18:49:53 -0000	1.5
+++ hal-luks-setup	17 May 2006 20:12:17 -0000	1.6
@@ -7,14 +7,16 @@
 # it under the terms of the GNU General Public License version 2.
 
 if [ -z "$HAL_PROP_BLOCK_DEVICE" ] || [ -z "$HAL_PROP_INFO_UDI" ] || [ -z "$HAL_PROP_VOLUME_UUID" ] ; then
+        echo "org.freedesktop.Hal.Device.UnknownError" >&2
         echo "Missing or empty environment variable(s)." >&2
         echo "This script should be started by hald." >&2
         exit 1
 fi
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-luks-teardown
===================================================================
RCS file: /cvs/hal/hal/tools/hal-luks-teardown,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hal-luks-teardown	14 May 2006 18:49:53 -0000	1.3
+++ hal-luks-teardown	17 May 2006 20:12:17 -0000	1.4
@@ -8,14 +8,16 @@
 
 # Check for environment variables
 if [ -z "$HAL_PROP_BLOCK_DEVICE" ] || [ -z "$HAL_PROP_INFO_UDI" ] || [ -z "$HAL_PROP_VOLUME_UUID" ] ; then
+        echo "org.freedesktop.Hal.Device.UnknownError" >&2
         echo "Missing or empty environment variable(s)." >&2
         echo "This script should be started by hald." >&2
         exit 1
 fi
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-system-lcd-get-brightness
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-lcd-get-brightness,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- hal-system-lcd-get-brightness	14 May 2006 18:49:53 -0000	1.10
+++ hal-system-lcd-get-brightness	17 May 2006 20:12:17 -0000	1.11
@@ -9,14 +9,16 @@
 
 # Check for environment variables
 if [ -z "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" ]; then
+        echo "org.freedesktop.Hal.Device.UnknownError" >&2
 	echo "Missing or empty environment variable(s)." >&2
 	echo "This script should be started by hald." >&2
 	exit 1
 fi
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-system-lcd-set-brightness
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-lcd-set-brightness,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- hal-system-lcd-set-brightness	14 May 2006 18:49:53 -0000	1.11
+++ hal-system-lcd-set-brightness	17 May 2006 20:12:17 -0000	1.12
@@ -10,6 +10,7 @@
 # Check for environment variables
 if [ -z "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" ] || 
    [ -z "$HAL_PROP_LAPTOP_PANEL_NUM_LEVELS" ] ; then
+        echo "org.freedesktop.Hal.Device.UnknownError" >&2
         echo "Missing or empty environment variable(s)." >&2
         echo "This script should be started by hald." >&2
         exit 1
@@ -27,9 +28,10 @@
 
 export value
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-system-power-hibernate
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-power-hibernate,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- hal-system-power-hibernate	14 May 2006 18:49:53 -0000	1.13
+++ hal-system-power-hibernate	17 May 2006 20:12:17 -0000	1.14
@@ -2,7 +2,7 @@
 
 POLICY=hal-power-hibernate
 if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
-    polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID
+    RESULT=$(polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID 2>&1)
     IS_PRIVILEGED=$?
     if [ "$IS_PRIVILEGED" != "0" ] ; then
 	echo org.freedesktop.Hal.Device.PermissionDeniedByPolicy >&2
@@ -11,9 +11,10 @@
     fi
 fi
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-system-power-reboot
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-power-reboot,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- hal-system-power-reboot	14 May 2006 18:49:53 -0000	1.7
+++ hal-system-power-reboot	17 May 2006 20:12:17 -0000	1.8
@@ -2,7 +2,7 @@
 
 POLICY=hal-power-reboot
 if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
-    polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID
+    RESULT=$(polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID 2>&1)
     IS_PRIVILEGED=$?
     if [ "$IS_PRIVILEGED" != "0" ] ; then
 	echo org.freedesktop.Hal.Device.PermissionDeniedByPolicy >&2
@@ -11,9 +11,10 @@
     fi
 fi
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-system-power-set-power-save
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-power-set-power-save,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- hal-system-power-set-power-save	14 May 2006 18:49:53 -0000	1.6
+++ hal-system-power-set-power-save	17 May 2006 20:12:17 -0000	1.7
@@ -1,8 +1,9 @@
 #!/bin/sh
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-system-power-shutdown
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-power-shutdown,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- hal-system-power-shutdown	14 May 2006 18:49:53 -0000	1.7
+++ hal-system-power-shutdown	17 May 2006 20:12:17 -0000	1.8
@@ -2,7 +2,7 @@
 
 POLICY=hal-power-poweroff
 if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
-    polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID
+    RESULT=$(polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID 2>&1)
     IS_PRIVILEGED=$?
     if [ "$IS_PRIVILEGED" != "0" ] ; then
 	echo org.freedesktop.Hal.Device.PermissionDeniedByPolicy >&2
@@ -11,9 +11,10 @@
     fi
 fi
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-system-power-suspend
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-power-suspend,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- hal-system-power-suspend	14 May 2006 18:49:53 -0000	1.13
+++ hal-system-power-suspend	17 May 2006 20:12:17 -0000	1.14
@@ -2,7 +2,7 @@
 
 POLICY=hal-power-suspend
 if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
-    polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID
+    RESULT=$(polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID 2>&1)
     IS_PRIVILEGED=$?
     if [ "$IS_PRIVILEGED" != "0" ] ; then
 	echo org.freedesktop.Hal.Device.PermissionDeniedByPolicy >&2
@@ -11,9 +11,10 @@
     fi
 fi
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-system-storage-cleanup-mountpoint
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-storage-cleanup-mountpoint,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hal-system-storage-cleanup-mountpoint	14 May 2006 18:49:53 -0000	1.2
+++ hal-system-storage-cleanup-mountpoint	17 May 2006 20:12:17 -0000	1.3
@@ -6,6 +6,7 @@
 # it under the terms of the GNU General Public License version 2.
 
 if [ -z "$HALD_CLEANUP" ]; then
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo Specify directory to clean up with the environment variable HALD_CLEANUP
     exit 1
 fi

Index: hal-system-storage-cleanup-mountpoints
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-storage-cleanup-mountpoints,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- hal-system-storage-cleanup-mountpoints	14 May 2006 18:49:53 -0000	1.4
+++ hal-system-storage-cleanup-mountpoints	17 May 2006 20:12:17 -0000	1.5
@@ -6,9 +6,10 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License version 2.
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-system-storage-eject
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-storage-eject,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- hal-system-storage-eject	14 May 2006 18:49:53 -0000	1.11
+++ hal-system-storage-eject	17 May 2006 20:12:17 -0000	1.12
@@ -8,6 +8,7 @@
 #
 # Check for environment variables
 if [ -z "$HAL_PROP_BLOCK_DEVICE" ] || [ -z "$HAL_PROP_INFO_UDI" ] ; then
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "Missing or empty environment variable(s)." >&2
     echo "This script should be started by hald." >&2
     exit 1
@@ -26,7 +27,7 @@
 # TODO: need to select storage-[fixed|removable][-change-uid]
 #POLICY=hal-storage-fixed-mount
 #if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
-#    polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID
+#    RESULT=$(polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID 2>&1)
 #    IS_PRIVILEGED=$?
 #    if [ "$IS_PRIVILEGED" != "0" ] ; then
 #	echo org.freedesktop.Hal.Device.PermissionDeniedByPolicy >&2
@@ -35,9 +36,10 @@
 #    fi
 #fi
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi

Index: hal-system-storage-unmount
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-storage-unmount,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- hal-system-storage-unmount	14 May 2006 18:49:53 -0000	1.12
+++ hal-system-storage-unmount	17 May 2006 20:12:17 -0000	1.13
@@ -8,6 +8,7 @@
 
 # Check for environment variables
 if [ -z "$HAL_PROP_BLOCK_DEVICE" ] || [ -z "$HAL_PROP_INFO_UDI" ] ; then
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "Missing or empty environment variable(s)." >&2
     echo "This script should be started by hald." >&2
     exit 1
@@ -46,7 +47,7 @@
 # TODO: need to select storage-[fixed|removable][-change-uid]
 #POLICY=hal-storage-fixed-mount
 #if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
-#    polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID
+#    RESULT=$(polkit-is-privileged --privilege $POLICY --user $HAL_METHOD_INVOKED_BY_UID 2>&1)
 #    IS_PRIVILEGED=$?
 #    if [ "$IS_PRIVILEGED" != "0" ] ; then
 #	echo org.freedesktop.Hal.Device.PermissionDeniedByPolicy >&2
@@ -55,9 +56,12 @@
 #    fi
 #fi
 
-if [ -n "$HALD_UNAME_S" -a -x ./$0-$HALD_UNAME_S ]; then
-    exec ./$0-$HALD_UNAME_S $@
+export MOUNT_POINT
+
+if [ -n "$HALD_UNAME_S" -a -x $0-$HALD_UNAME_S ]; then
+    exec $0-$HALD_UNAME_S $@
 else
+    echo "org.freedesktop.Hal.Device.UnknownError" >&2
     echo "No back-end for your operating system" >&2
     exit 1
 fi




More information about the hal-commit mailing list