Bug 28964

Summary: Shifting plasma from user to root
Product: Mageia Reporter: Jybz <j.biernacki+mga>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED OLD QA Contact:
Severity: normal    
Priority: Normal CC: davidwhodgins, fri, lewyssmith, ouaurelien
Version: 8   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: CVE:
Status comment:

Description Jybz 2021-05-25 12:32:04 CEST
There is a high bug, plasma shifting to root user.

Open a terminal,
> su -
> <root password>
> dolphin
right-click, open a terminal here,
(I don't remember what I did),
exit the terminal, exit dolphin, exit root from the first terminal.
try a screenshot, spectable a the root's theme
saving the screenshot is by default in /root with root rights.

We have a user reporting [CTRL]+[ALT]+[T] (terminal shortcur) open a root session after the same process.
Comment 1 Jybz 2021-05-25 12:32:41 CEST
spectable has the root's theme *
Comment 2 Morgan Leijström 2021-05-25 13:38:02 CEST
Does this repeatable every time on your system?
- Or just when you did not remember what you did?

I can not replicate.
I am testing on my main system, upgraded from mga7, and old user account.

CC: (none) => fri

Comment 3 Jybz 2021-05-25 13:50:30 CEST
> $ uptime 
> 13:41:18 up 14 days, 22:58, 20 users,  load average: 1,06, 1,26, 0,99

I don't know if I will reproduce it, I don't restart my main computer often as i'm working on signals (matlab/octave) with a lot of memory usage.

I'm trying as one user (fresh install of mga8 + plasma customization) reports it, and I reproduce it on my system (mga7+update in february to mga8, up to date, no plasma customization).
Comment 4 Aurelien Oudelet 2021-05-25 15:04:10 CEST
Investigating. Running MGA8 Plasma x86_64

mai 25 14:48:56 systemd[5973]: Started Konsole - Terminal.
mai 25 14:48:56 mageia.local su[36194]: (to root) aurelien on pts/1
mai 25 14:48:56 mageia.local su[36194]: pam_unix(su-l:session): session opened for user root by aurelien(uid=1000)

Become root by doing "su -"

mai 25 14:48:56 mageia.local dbus-daemon[1253]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.109' (uid=0 pid=36205 comm="/usr/bin/hostnamectl --transient")
mai 25 14:48:56 mageia.local systemd[1]: Starting Hostname Service...
mai 25 14:48:56 mageia.local dbus-daemon[1253]: [system] Successfully activated service 'org.freedesktop.hostname1'
mai 25 14:48:56 mageia.local systemd[1]: Started Hostname Service.

Running "# dolphin"

mai 25 14:49:00 mageia.local dbus-daemon[36238]: [session uid=0 pid=36236] Activating service name='org.kde.ActivityManager' requested by ':1.0' (uid=0 pid=36231 comm="dolphin")
mai 25 14:49:00 mageia.local kactivitymanagerd[36241]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
mai 25 14:49:00 mageia.local kactivitymanagerd[36241]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
mai 25 14:49:00 mageia.local dbus-daemon[36238]: [session uid=0 pid=36236] Successfully activated service 'org.kde.ActivityManager'
mai 25 14:49:00 mageia.local dbus-daemon[36238]: [session uid=0 pid=36236] Activating service name='org.kde.kglobalaccel' requested by ':1.1' (uid=0 pid=36241 comm="/usr/libexec/kactivitymanagerd")
mai 25 14:49:00 mageia.local kglobalaccel5[36249]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
mai 25 14:49:00 mageia.local kglobalaccel5[36249]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
mai 25 14:49:00 mageia.local dbus-daemon[36238]: [session uid=0 pid=36236] Successfully activated service 'org.kde.kglobalaccel'
mai 25 14:49:26 mageia.local systemd[1]: systemd-hostnamed.service: Succeeded.
mai 25 14:49:37 mageia.local su[36194]: pam_unix(su-l:session): session closed for user root

Closing Dolphin.
Closing Konsole.

Launch Spectacle. It is owned by my user.

But, they are remaining root owned process:
dbus-launch
dbus-daemon
kactivitymanagerd
kglobalaccel5
kdeinit5:
klauncher

If root account as configured keyboard shortcut, pressing "Print Screen" key can result to load Spectacle as root... But, on my system, I think there is no global keyboard shortcuts activated for root user. So, this is Spectacle owned by "aurelien" which is launched. Even if this is a root owned window that is in focus.

This is not recommended to launch root owned GUI Application, moreover a File manager. This can lead to a system breakage, or getting your user account to be messed up, and not being able to logon next reboot.

I can't reproduce the bug from the above "Steps to replicate". I suppose original reporter should did become root with a "su" rather "su -"... In this case, the session Environment is not correctly clean up, resulting root owned process with access to the user session environment.

CC: (none) => ouaurelien
Ever confirmed: 1 => 0
Status: NEW => UNCONFIRMED

Comment 5 Dave Hodgins 2021-05-25 19:01:10 CEST
I also cannot recreate the issue. Tested on a system upgraded from Mageia 7 and
on a second system with a clean install of Mageia 8. Both systems have minimal
customizations, as I use them primarily for testing. In both cases the
screenshot was saved in /home/dave/Pictures.

I also tested using just su instead of su -, and dolphin fails to launch with
"Session bus not found", as intended by kde, so that's not the issue.

CC: (none) => davidwhodgins

Comment 6 Lewis Smith 2021-05-25 20:52:22 CEST
Trying this M8 Mate:
[start a terminal]
$ su -
{password]
# pwd
/root
# ls 
aif-mount/  drakx/  tmp/
# dolphin
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' x n
"Running Dolphin as root can be dangerous. Please be careful"
Shows same file/directories as above
From Dolphin RH menu, choose 'Open Terminal'
# pwd
/root
# ls
aif-mount/  drakx/  tmp/
exit   [Dolphin terminal]
Close Dolphin; returns to first terminal, still as root.
exit   [root shell]
Returns to the cleared terminal window
Use Spectacle to take a screenshot, SaveAs into ~/Pictures
-rw-rw-r-- 1 lewis lewis 181871 Mai  25 20:38  Screenshot_20210525_203844.png
exit   [original terminal]

This is another bug where the 'steps to reproduce' are not convincing.
If anyone can reproduce this, because the path is somewhat tortuous, please be meticulous about noting every step; and confirm with 'id', 'pwd' and 'ls' exactly where you are & what you are seeing at every stage.
Perhaps I have Spectacle wrong, but it needed a 'SaveAs' operation after 'TakeNewScreenshot' to define where to save the result. I looks from the Description as if it landed up in /root all by itself.

CC: (none) => lewyssmith

Comment 7 Lewis Smith 2021-05-25 21:01:38 CEST
I realise I should have done all that under Plasma! I will try it there once the use of Spectacle (how the file gets into /root) is clarified.
Comment 8 Aurelien Oudelet 2021-05-26 18:07:29 CEST
(In reply to Lewis Smith from comment #6)
> <snip>
> This is another bug where the 'steps to reproduce' are not convincing.

Agreed.

> If anyone can reproduce this, because the path is somewhat tortuous, please
> be meticulous about noting every step; and confirm with 'id', 'pwd' and 'ls'
> exactly where you are & what you are seeing at every stage.
> Perhaps I have Spectacle wrong, but it needed a 'SaveAs' operation after
> 'TakeNewScreenshot' to define where to save the result. I look from the
> Description as if it landed up in /root all by itself.

We really need to know all steps carefully noted. You can even write them in French from Original reporter in MLO forum/IRC.

(In reply to Lewis Smith from comment #7)
> I realise I should have done all that under Plasma! I will try it there once
> the use of Spectacle (how the file gets into /root) is clarified.

No need for this. I tried with my main Mageia 8, totally "vanilla" from our ISO, no customisation. I tried also from the Plasma Live ISO. Not reproduced.

I don't have "Open in a Terminal as root" in right-click context menu in Dolphin.
Beware on third party tools from KNewStuff that can potentially be harmful on certain systems.

Leaving this opened for 2 weeks.

Status: UNCONFIRMED => NEEDINFO
Ever confirmed: 0 => 1

Comment 9 Morgan Leijström 2021-05-26 20:17:44 CEST
(In reply to Aurelien Oudelet from comment #8)
> I don't have "Open in a Terminal as root" in right-click context menu in
> Dolphin.

Right click a folder, then in submenu "Actions" you find it.


(In reply to Aurelien Oudelet from comment #4)
> But, they are remaining root owned process:

Isnt that a bug in itself already there?
Comment 10 Aurelien Oudelet 2021-05-30 16:26:07 CEST
(In reply to Morgan Leijström from comment #9)
> (In reply to Aurelien Oudelet from comment #8)
> > I don't have "Open in a Terminal as root" in right-click context menu in
> > Dolphin.
> 
> Right click a folder, then in submenu "Actions" you find it.

This is not available by default under Plasma session, either from Classic ISO, either from Live DVD/ISO. So, no, I don't know how you get such action under Dolphin.
This is unsupported upstream. Plasma Devs do not recommend to run Plasma stuff as root user.

> 
> (In reply to Aurelien Oudelet from comment #4)
> > But, they are remaining root owned process:
> 
> Isnt that a bug in itself already there?

No, as long as you start as root, under a pseudo-tty, a GUI program, this is like running MCC. But, there, you want a Plasma GUI (Dolphin,...). That GUI wants some background stuff to properly run, that's why such process are run.

There is nothing we can do.

And, that's why you should not run GUI as root under your user session.
Note that Kate/Kwrite text editor are able to Save a text-based file as root user with a PolicyKit (polkit) rule asking for root password.

This is under development for Dolphin.
Comment 11 Aurelien Oudelet 2021-07-13 23:17:00 CEST
Since there are insufficient details provided in this report for us to investigate the issue further, and we have not received feedback to the information we have requested above, we will assume the problem was not reproducible, or has been fixed in one of the updates we have released for the reporter's distribution.

Users who have experienced this problem are encouraged to reinstall from scratch and to apply the latest update of their distribution, and if this issue turns out to still be reproducible in the latest update, please reopen this bug with additional information.

Closing as OLD.

Resolution: (none) => OLD
Status: NEEDINFO => RESOLVED