[Bug 1958055] Re: sudo apport-kde is in a different design (stripped XDG_CURRENT_DESKTOP)
Benjamin Drung
1958055 at bugs.launchpad.net
Mon Sep 12 09:51:18 UTC 2022
The change of the mode of debian/source_sudo.py was unintentional (I
used the git checkout from Debian to put the changes on top). I
reuploaded the jammy SRU without the mode change of
debian/source_sudo.py.
> Is there any possibility that passing through this environment
variable when we previously did not will change behaviour in such a way
that a user treats that as a regression? For example, if some user has a
setting that causes some app to now break, when it didn't before?
XDG_CURRENT_DESKTOP is probably only taken into account by UI
applications. If setting this variable causes a code path change and a
regression for this one, the same regression should be triggered by
running the application without sudo.
If the user blocked passing environment variables like DISPLAY, setting
only XDG_CURRENT_DESKTOP did not made UI applications start (tested
with: sudo env -i XDG_CURRENT_DESKTOP=$XDG_CURRENT_DESKTOP gnome-
calculator)
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to sudo in Ubuntu.
https://bugs.launchpad.net/bugs/1958055
Title:
sudo apport-kde is in a different design (stripped
XDG_CURRENT_DESKTOP)
Status in sudo package in Ubuntu:
Fix Released
Status in sudo source package in Jammy:
Triaged
Bug description:
[Impact]
Running ubuntu-bug as normal user has the correct theme (see
screenshots attached to bug #1881640), but running "sudo ubuntu-bug"
has a different, non-matching theme (see attached screenshot). This
applies to all Qt applications.
[Test Plan]
This problem can be reproduce by running a KDE application on Ubuntu
Desktop (GNOME):
1. Launch ubuntu-22.04-desktop-amd64.iso
2. Install apport-kde
3. Run: /usr/share/apport/apport-kde -f
4. Run: sudo /usr/share/apport/apport-kde -f
5. Compare both windows. They have different icons and font size.
Same result with KDE:
1. Use kubuntu-22.04-desktop-amd64.iso
2. Run ubuntu-bug -f
3. Run: sudo ubuntu-bug -f
[Where problems could occur]
Passing through an additional environment variable could lead to an undesired side effect (if an application expect it not be be set when run as root). Since this environment variable changes the code paths, it could reveal Qt bugs related to running as root.
[Analysis]
Qt needs XDG_CURRENT_DESKTOP to be set to determine the correct theme,
but XDG_CURRENT_DESKTOP is not in the list of environment variables to
preserve (and not in env_keep in /etc/sudoers).
On other other hand, sudo preserves the DISPLAY environment variable:
$ sudo env | grep -Ev '^(LC|LS|SUDO|LANG|COLOR|TERM|PATH)'
XAUTHORITY=/run/user/1000/gdm/Xauthority
DISPLAY=:0
MAIL=/var/mail/root
LOGNAME=root
USER=root
HOME=/root
SHELL=/bin/bash
[Workaround]
Prevent sudo from dropping XDG_CURRENT_DESKTOP by running: sudo
XDG_CURRENT_DESKTOP=$XDG_CURRENT_DESKTOP /usr/share/apport/apport-kde
-f
[Other Info]
This changes was accepted upstream: https://github.com/sudo-
project/sudo/pull/165
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: apport 2.20.9-0ubuntu7.27
ProcVersionSignature: Ubuntu 5.4.0-94.106~18.04.1-generic 5.4.157
Uname: Linux 5.4.0-94-generic i686
ApportVersion: 2.20.9-0ubuntu7.27
Architecture: i386
CurrentDesktop: KDE
Date: Sun Jan 16 05:04:24 2022
InstallationDate: Installed on 2022-01-15 (0 days ago)
InstallationMedia: Kubuntu 18.04.5 LTS "Bionic Beaver" - Release i386 (20200806.1)
PackageArchitecture: all
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/1958055/+subscriptions
More information about the foundations-bugs
mailing list