| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/libexec/scripts/ |
Upload File : |
#!/bin/bash
# Copyright (C) 2005 W. Michael Petullo <mike@flyn.org>
# Copyright (C) 2006 David Zeuthen <davidz@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
. hal-functions
locked_out() {
echo "org.freedesktop.Hal.Device.InterfaceLocked" >&2
echo "Enclosing drive/volume is locked" >&2
exit 1
}
unknown_error() {
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
}
# Check for environment variables
if [ -z "$HAL_PROP_BLOCK_DEVICE" ] || [ -z "$HAL_PROP_INFO_UDI" ] || [ -z "$HAL_PROP_VOLUME_UUID" ] ; then
unknown_error
fi
# Respect the same locks as Mount()/Unmount() etc.
if [ -n "$HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME" ] ; then
hal-is-caller-locked-out --udi $HAL_PROP_INFO_UDI \
--interface org.freedesktop.Hal.Device.Volume \
--caller "$HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME"
RET=$?
if [ "$RET" != "0" ] ; then
locked_out
fi
hal-is-caller-locked-out --udi $HAL_PROP_BLOCK_STORAGE_DEVICE \
--interface org.freedesktop.Hal.Device.Storage \
--caller "$HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME"
RET=$?
if [ "$RET" != "0" ] ; then
locked_out
fi
fi
# TODO: this is a little sketchy; we should check for hal-storage-crypto-teardown-others?
#
IS_HOTPLUGGABLE=`hal-get-property --udi $HAL_PROP_BLOCK_STORAGE_DEVICE --key storage.hotpluggable`
if [ "$IS_HOTPLUGGABLE" == "true" ] ; then
ACTION="org.freedesktop.hal.storage.crypto-setup-removable"
elif [ "$IS_HOTPLUGGABLE" == "false" ] ; then
ACTION="org.freedesktop.hal.storage.crypto-setup-fixed"
else
unknown_error
fi
hal_check_priv $ACTION
hal_exec_backend