Bug 458096

Summary: Plasmashell restricted (variables) environment
Product: [Plasma] plasmashell Reporter: Filipe Azevedo <pasnox>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: avistorque, kde, nate
Priority: NOR    
Version First Reported In: 5.25.4   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: env issue

Description Filipe Azevedo 2022-08-20 12:10:42 UTC
Created attachment 151448 [details]
env issue

SUMMARY
Applications started from plasmashell (like kickoff, panels) get a restricted environment (variable environment), where some variables are missing compared to applications started from krunner.
Especially, dbus related variables are not leaked making flatpak and AppImage applications would not be able to communicate with system dbus, and fails to get wallet access.
By example, gajim, ruqola, chrome ran from flatpak / appimage can not access passwords.


STEPS TO REPRODUCE
1.  Start konsole from krunner
2.  type command: export | grep DBUS
3.  See there is 6 variables
4. Pin konsole to a panel
5. Right click this pined app and click open new window
6. Type command from 2.

OBSERVED RESULT
6. Variables does not match the one from 2.

EXPECTED RESULT
6. variables match one from 2.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version:  5.25.4
KDE Frameworks Version:  5.97
Qt Version: 5.15.5+

ADDITIONAL INFORMATION
The issue is there since some versions now, It was working fine before.
Comment 1 Nate Graham 2022-08-23 12:33:49 UTC
Cannot reproduce; the commands set are identical for me:
DBUS_SESSION_BUS_ADDRESS
KONSOLE_DBUS_SERVICE
KONSOLE_DBUS_SESSION
KONSOLE_DBUS_WINDOW
Comment 2 Filipe Azevedo 2022-08-23 12:38:13 UTC
(In reply to Nate Graham from comment #1)
> Cannot reproduce; the commands set are identical for me:
> DBUS_SESSION_BUS_ADDRESS
> KONSOLE_DBUS_SERVICE
> KONSOLE_DBUS_SESSION
> KONSOLE_DBUS_WINDOW

Did you run the second konsole from the panel pinned konsole ?
What if you then close everything and try to start konsole from pinned only ?
Comment 3 Nate Graham 2022-08-25 07:06:11 UTC
I did, yes. No change.
Comment 4 Nate Graham 2022-08-25 07:06:54 UTC
Which distro are you using?
Comment 5 Filipe Azevedo 2022-08-25 07:08:43 UTC
I'm running the KaOS distribution being up to date to today.
I can reproduce the issue with 2 different machines and users.
Comment 6 Filipe Azevedo 2022-08-25 07:09:20 UTC
(In reply to Filipe Azevedo from comment #5)
> I'm running the KaOS distribution being up to date to today.
> I can reproduce the issue with 2 different machines and users.

https://kaosx.us/pages/download/
Comment 7 Nate Graham 2022-08-25 07:40:16 UTC
Cool, I'm on Fedora and I can't. I would recommend that you bring this up with the KaOS maintainers as it's quite possible that they're patching something. Thanks!
Comment 8 Filipe Azevedo 2022-08-25 07:41:59 UTC
(In reply to Nate Graham from comment #7)
> Cool, I'm on Fedora and I can't. I would recommend that you bring this up
> with the KaOS maintainers as it's quite possible that they're patching
> something. Thanks!

Yes, I have brig it to us already.
Will try to collect from here if some other distrib users can reproduce or not as well.
Comment 9 Nate Graham 2022-08-25 07:45:07 UTC
Thanks, let us know.
Comment 10 Roman 2022-09-03 06:57:52 UTC
Can confirm same thing happens on Manjaro(5.25.4).
Comment 11 Filipe Azevedo 2022-09-03 08:00:56 UTC
(In reply to Roman from comment #10)
> Can confirm same thing happens on Manjaro(5.25.4).

Like having the issue or working correctly!
Please mark it confirmed if needed.
Comment 12 Milian Wolff 2022-09-13 08:56:07 UTC
cannot reproduce on Arch.

Krunner:
```
declare -x DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"
declare -x KONSOLE_DBUS_SERVICE=":1.179"
declare -x KONSOLE_DBUS_SESSION="/Sessions/1"
declare -x KONSOLE_DBUS_WINDOW="/Windows/1"
```

pinned konsole from plasmashell:
```
declare -x DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"
declare -x KONSOLE_DBUS_SERVICE=":1.178"
declare -x KONSOLE_DBUS_SESSION="/Sessions/1"
declare -x KONSOLE_DBUS_WINDOW="/Windows/1"
```
Comment 13 Filipe Azevedo 2022-09-21 08:11:56 UTC
Fixed, the OS package was not enabling user session support for the dbus package leading to this break.