sudo apport-kde is in a different design (stripped XDG_CURRENT_DESKTOP)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sudo (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Medium
|
Unassigned |
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-
2. Install apport-kde
3. Run: /usr/share/
4. Run: sudo /usr/share/
5. Compare both windows. They have different icons and font size.
Same result with KDE:
1. Use kubuntu-
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|
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_
[Other Info]
This changes was accepted upstream: https:/
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: apport 2.20.9-0ubuntu7.27
ProcVersionSign
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)
PackageArchitec
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install)
summary: |
- Sudo ubuntu-bug is in different design. Added screenshots + sudo ubuntu-bug is in a different design |
summary: |
- sudo ubuntu-bug is in a different design + sudo apport-kde is in a different design |
description: | updated |
tags: |
added: jammy removed: i386 |
description: | updated |
description: | updated |
tags: | added: patch |
Changed in sudo (Ubuntu): | |
status: | Confirmed → Fix Committed |
Changed in sudo (Ubuntu Jammy): | |
status: | New → Fix Committed |
Changed in sudo (Ubuntu Jammy): | |
status: | New → Triaged |
importance: | Undecided → Medium |
Re-assigning this ticket to sudo. IMO XDG_CURRENT_DESKTOP should be added to the list of environment variables to preserve, e.g. by adding it to env_keep in /etc/sudoers.