mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-10-01 08:25:45 -04:00
pkexec wrapper: fix gdebi / synaptic
but at cost of checking for passwordless sudo /etc/suders /etc/sudoers.d exceptions. http://forums.whonix.org/t/cannot-use-pkexec/8129/53
This commit is contained in:
parent
32269d32b6
commit
649ec5dfa1
@ -104,14 +104,15 @@ exit_code=0
|
||||
|
||||
## lxqt-sudo does not check /etc/sudoers / /etc/sudoers.d exceptions.
|
||||
## Therefore use 'sudo -l' to see if there is any already existing sudoers exception.
|
||||
if sudo -l --non-interactive $maybe_switch_to_user --set-home PKEXEC_UID="$PKEXEC_UID" "$@" ; then
|
||||
log_to_journal "sudoers exception: yes"
|
||||
sudo --non-interactive $maybe_switch_to_user --set-home PKEXEC_UID="$PKEXEC_UID" "$@" || { exit_code=$? ; true; };
|
||||
log_to_journal "sudo --user | exit_code: '$exit_code'"
|
||||
exit "$exit_code"
|
||||
fi
|
||||
|
||||
log_to_journal "sudoers exception: no"
|
||||
## Did not work. 'sudo -l' will always exit with exit code '0'.
|
||||
# if sudo -l --non-interactive $maybe_switch_to_user --set-home PKEXEC_UID="$PKEXEC_UID" "$@" ; then
|
||||
# log_to_journal "sudoers exception: yes"
|
||||
# sudo --non-interactive $maybe_switch_to_user --set-home PKEXEC_UID="$PKEXEC_UID" "$@" || { exit_code=$? ; true; };
|
||||
# log_to_journal "sudo --user | exit_code: '$exit_code'"
|
||||
# exit "$exit_code"
|
||||
# fi
|
||||
#
|
||||
# log_to_journal "sudoers exception: no"
|
||||
|
||||
if [ "$switch_user" = "true" ]; then
|
||||
## 'sudo --user user' clears environment variables such as PATH.
|
||||
|
Loading…
Reference in New Issue
Block a user