set SUDO_ASKPASS for pkexec wrapper when using sudo --askpass

This commit is contained in:
Patrick Schleizer 2019-10-22 09:04:44 -04:00
parent 1a65a91039
commit d4e02de43a
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48
2 changed files with 12 additions and 1 deletions

View File

@ -87,7 +87,8 @@ PATH="$(sudo --non-interactive /usr/lib/security-misc/echo-path)"
export PATH
if [ "$use_sudo" = "true" ]; then
sudo --askpass --user "$user_pkexec_wrapper" --set-home "$@"
SUDO_ASKPASS="/usr/lib/security-misc/askpass" \
sudo --askpass --user "$user_pkexec_wrapper" --set-home "$@"
else
lxqt-sudo "$@"
fi

10
usr/lib/security-misc/askpass Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
## Copyright (C) 2019 - 2019 ENCRYPTED SUPPORT LP <adrelanos@riseup.net>
## See the file COPYING for copying conditions.
set -e
title="$0: password required for $(whoami) to perform action as superuser"
zenity --password --title="$title"