Bug 423059 - KRunner is running with root privileges
Summary: KRunner is running with root privileges
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: 5.19.0
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: Kai Uwe Broulik
URL:
Keywords:
: 435130 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-06-16 15:18 UTC by WAWalkenhorst
Modified: 2021-03-31 16:49 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.81


Attachments
ps aux after bug happened (56.33 KB, text/plain)
2021-01-26 15:53 UTC, Daniel Noga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description WAWalkenhorst 2020-06-16 15:18:17 UTC
SUMMARY
Logged on as user x, but KRunner is running as root. (different theme, and e.g. steam complains it cannot be run as root, while yast2 can be started without any password request.

STEPS TO REPRODUCE
1. Startup
2. Login
3. Alt-Tab, enter yast2, hit enter

OBSERVED RESULT
YAST2 launches without (root)password dialog

EXPECTED RESULT
YAST2 asks for root password

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 

Operating System: openSUSE Tumbleweed 20200614
KDE Plasma Version: 5.19.0
KDE Frameworks Version: 5.70.0
Qt Version: 5.15.0
Kernel Version: 5.7.1-1-default
OS Type: 64-bit
Processors: 12 × AMD Ryzen 5 3600X 6-Core Processor
Memory: 31,3 GiB Arbeitsspeicher
Graphics Processor: Radeon RX 580 Series 

ADDITIONAL INFORMATION
Killed krunner and started again from KDE Menue, same result.
Comment 1 Alexander Lohnau 2020-06-16 16:00:48 UTC
On KDE Neon unstable it runs with user privileges.

Can maybe one of the SUSE users have a look?
Comment 2 WAWalkenhorst 2020-06-16 18:51:25 UTC
If there is a howto I can also send logs or debug messages. Whatever is helpful.
Comment 3 Nate Graham 2020-06-16 19:00:40 UTC
I'm on openSUSE Tumbleweed too, with that same snapshot, and my KRunner is running with user privileges. This seems like a local config issue. Did you accidentally login as root yourself, maybe?
Comment 4 WAWalkenhorst 2020-06-16 19:16:09 UTC
No, I don't use kde as root, always su'ing. 

It maybe a rare condition but that is why I didn't restart, hoping it could be found and eliminated.
Comment 5 WAWalkenhorst 2020-06-16 19:44:09 UTC
I rebooted, now krunner is behaving as expected.
Comment 6 WAWalkenhorst 2020-06-16 19:47:26 UTC
I guess you can close the ticket, since the error isn'T reproducible anymore.

Thank you
Comment 7 Daniel Noga 2020-12-16 17:36:40 UTC
Just the same happened to me...

openSUSE Leap 15.2:
Plasma: 5.18.5
Frameworks: 5.71.0
QT: 5.12.7

I see running both processes Krunner as user and as root in System activities. If I kill root variant and try to hit Alt+F2 to activate krunner, root variant starts again
Comment 8 Daniel Noga 2020-12-16 17:39:47 UTC
Restart "solved" the issue
Comment 9 Daniel Noga 2020-12-16 17:47:40 UTC
And one more observation. It is probably not krunner problem, but keyboard shortcuts problem. Before restart, I cannot run Spectacle via PrintScreen key and via "root Krunner". Via Konsole it was possible. 

So I think Spectacle tried to run as root via PrintScreen too.
Comment 10 Nate Graham 2020-12-16 17:51:16 UTC
Seems like the kglobalaccel daemon (which is responsible for launching KRunner and Spectacle) got run as root. Can you check to see if this is the case?
Comment 11 Daniel Noga 2020-12-16 17:53:17 UTC
Unfortunately I already restarted computer and now everything works fine again. But I would check it, when it happens next time.
Comment 12 Nate Graham 2020-12-16 17:55:32 UTC
OK thanks!
Comment 13 Bug Janitor Service 2020-12-31 04:34:16 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 14 Nate Graham 2021-01-12 00:58:45 UTC

*** This bug has been marked as a duplicate of bug 429435 ***
Comment 15 Daniel Noga 2021-01-26 15:52:46 UTC
It is not duplicate mentioned task. In mentioned task is nothing about root.

Just happened again. And yes, that service is running as user and root
Comment 16 Daniel Noga 2021-01-26 15:53:08 UTC
Created attachment 135213 [details]
ps aux after bug happened
Comment 17 Daniel Noga 2021-01-26 15:59:40 UTC
I dumped sudo journalctl --since=today > ~/Stažené/dump-of-journalctl.txt

How safe it is include it into bugzilla? Can be there some private data, which should I censore?
Comment 18 Daniel Noga 2021-01-26 16:08:43 UTC
cat ~/Stažené/dump-of-journalctl.txt | grep global
led 26 09:05:45 linux-fyol dbus-daemon[2779]: [session uid=1000 pid=2779] Activating service name='org.kde.kglobalaccel' requested by ':1.12' (uid=1000 pid=2927 comm="/usr/bin/kaccess ")
led 26 09:05:45 linux-fyol dbus-daemon[2779]: [session uid=1000 pid=2779] Successfully activated service 'org.kde.kglobalaccel'
led 26 09:05:46 linux-fyol kded5[2921]: QDBusConnection: name 'org.kde.kglobalaccel' had owner '' but we thought it was ':1.15'
led 26 13:27:13 linux-fyol dbus-daemon[20116]: [session uid=0 pid=20114] Activating service name='org.kde.kglobalaccel' requested by ':1.1' (uid=0 pid=20118 comm="/usr/lib64/libexec/kactivitymanagerd ")
led 26 13:27:14 linux-fyol kglobalaccel5[20125]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
led 26 13:27:14 linux-fyol kglobalaccel5[20125]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
led 26 13:27:14 linux-fyol kglobalaccel5[20125]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
led 26 13:27:14 linux-fyol kglobalaccel5[20125]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
led 26 13:27:14 linux-fyol dbus-daemon[20116]: [session uid=0 pid=20114] Successfully activated service 'org.kde.kglobalaccel'
led 26 16:48:06 linux-fyol org.kde.kglobalaccel[20116]: Error: org.freedesktop.DBus.Error.Spawn.ChildSignaled
led 26 16:48:06 linux-fyol org.kde.kglobalaccel[20116]: Process org.kde.Spectacle received signal 6
led 26 16:48:13 linux-fyol org.kde.kglobalaccel[20116]: Error: org.freedesktop.DBus.Error.Spawn.ChildSignaled
led 26 16:48:13 linux-fyol org.kde.kglobalaccel[20116]: Process org.kde.Spectacle received signal 6
led 26 16:48:13 linux-fyol org.kde.kglobalaccel[20116]: Error: org.freedesktop.DBus.Error.Spawn.ChildSignaled
led 26 16:48:13 linux-fyol org.kde.kglobalaccel[20116]: Process org.kde.Spectacle received signal 6
led 26 16:48:13 linux-fyol org.kde.kglobalaccel[20116]: Error: org.freedesktop.DBus.Error.Spawn.ChildSignaled
led 26 16:48:13 linux-fyol org.kde.kglobalaccel[20116]: Process org.kde.Spectacle received signal 6
led 26 16:48:13 linux-fyol org.kde.kglobalaccel[20116]: Error: org.freedesktop.DBus.Error.Spawn.ChildSignaled
led 26 16:48:13 linux-fyol org.kde.kglobalaccel[20116]: Process org.kde.Spectacle received signal 6
Comment 19 Daniel Noga 2021-01-26 16:24:07 UTC
And I know now, why kglobalaccel5 runs as root:
* Alt+F2 to run Krunner
* type "kdesu kate /etc/hosts"
* edit it
* CTRL + S to save it

-> now kglobalaccel5 runs both as root and as user

But printscreen still works now, after I tried to reproduce it. So I am not sure, what changed, that kglobalaccel5 root start grabbing keyboard shortcuts instead of user instance
Comment 20 Nate Graham 2021-03-26 14:58:31 UTC
Fixed by Fabian Vogt with https://invent.kde.org/frameworks/kglobalaccel/-/commit/bbec74337b3186bc258bd5adf849b89191789535 in Frameworks 5.81
Comment 21 Alois Wohlschlager 2021-03-31 16:12:21 UTC
*** Bug 435130 has been marked as a duplicate of this bug. ***
Comment 22 Nate Graham 2021-03-31 16:49:10 UTC
*** Bug 435130 has been marked as a duplicate of this bug. ***