Skip to content

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

Open
insertjokehere wants to merge 1 commit intodburr:masterfrom
insertjokehere:fix_root_check
Open

Fix 'run with sudo' check to check euid as well as sudo environment variable#3
insertjokehere wants to merge 1 commit intodburr:masterfrom
insertjokehere:fix_root_check

Conversation

@insertjokehere
Copy link

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

…ariable

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 added a commit to insertjokehere/linux-ibeacon that referenced this pull request Sep 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant