Skip to content

Commit

Permalink
synaptic-pkexec: Do not use pkexec under Wayland; warn users instead
Browse files Browse the repository at this point in the history
Co-authored-by: Boyuan Yang <byang@debian.org>
  • Loading branch information
zhsj and hosiet committed Apr 13, 2019
1 parent 74ffe7a commit 5f3151b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ X-Ubuntu-Use-Langpack: yes

Package: synaptic
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, hicolor-icon-theme, policykit-1
Depends: ${shlibs:Depends}, ${misc:Depends}, hicolor-icon-theme, policykit-1, zenity
Conflicts: menu (<< 2.1.11)
Recommends: libgtk2-perl (>= 1:1.130), xdg-utils
Suggests: dwww, menu, deborphan, apt-xapian-index, tasksel, software-properties-gtk
Expand Down
19 changes: 18 additions & 1 deletion debian/synaptic-pkexec
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
#!/bin/sh
pkexec "/usr/sbin/synaptic" "$@"

USING_WAYLAND=0
if [ ! "x${WAYLAND_DISPLAY}" = "x" ]; then
USING_WAYLAND=1
fi
if [ "x${XDG_SESSION_TYPE}" = "xwayland" ]; then
USING_WAYLAND=1
fi

if [ "x${USING_WAYLAND}" = "x1" ]; then
# Running wayland; start synaptic without pkexec
zenity --warning --width=500 --text \
"You are using Wayland environment, Synaptic will continue without administrative privileges.\\n\
To make Synaptic fully functional, please restart your session without Wayland."
exec "/usr/sbin/synaptic" "$@"
else
pkexec "/usr/sbin/synaptic" "$@"
fi

0 comments on commit 5f3151b

Please sign in to comment.