linux-ibeacon icon indicating copy to clipboard operation
linux-ibeacon copied to clipboard

Fix 'run with sudo' check to check euid as well as sudo environment variable

Open insertjokehere opened this issue 9 years ago • 0 comments

At present, the check_for_sudo function checks for the presence of an environment variable to see if the command was run with sudo, and therefore has the correct permissions to interact with the bluetooth device. This does not work in cases where the script is invoked directly, for example from a systemd unit or init script

This patch extends check_for_sudo to examine the effective uid to see if it is '0' (root) if the environment variable is not found

insertjokehere avatar Sep 29 '16 02:09 insertjokehere