Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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