[kiocore] assert that klauncher is running or not
ClosedPublic

Authored by bshah on Aug 22 2017, 10:00 AM.

Details

Summary

We are currently checking if the klauncher is running under different
user, and if so, we decide to fork the slave.

In addition to that also assert that klauncher is actually running or
not, if klauncher is not installed due to kinit being higher tier
framework then the kio or due to the usage of kio slave on !plasma
environments where kinit is very less likely to be installed.

This also helps packagers to avoid the circular dependency between kio
and kinit. For example,

Test Plan

Tested on openbox session where kdeinit5 was not functional

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bshah created this revision.Aug 22 2017, 10:00 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptAug 22 2017, 10:00 AM
sitter edited edge metadata.Aug 22 2017, 10:50 AM

LGTM.

Also can confirm this fixes the original problem of defunct kfileopen dialogs.

bshah updated this revision to Diff 18534.Aug 22 2017, 11:16 AM

more references of downstream bug

bshah edited the summary of this revision. (Show Details)Aug 22 2017, 11:17 AM
dfaure edited edge metadata.Aug 23 2017, 8:45 PM

Makes sense.

src/core/slave.cpp
111

} else if (...) {

We don't want/need to turn reply into a bool if it's not valid.

Alternatively this could be written as

if (!reply.isValid() || getuid() != reply) // not running, or owned by a different user

but I don't mind either way.

Just remove "assert" from the commit message, this isn't asserting anything, it's handling an error case that the code wasn't handling (at least not correctly).

bshah marked an inline comment as done.Aug 24 2017, 4:51 AM
bshah added inline comments.
src/core/slave.cpp
111

somehow arc diff is failing on me to update this change's summary and description.. I will commit this change and summary change .

This revision was automatically updated to reflect the committed changes.
bshah marked an inline comment as done.
sitter added a comment.EditedAug 24 2017, 6:01 AM

You committed (... && getuid() != reply) rather than ||. We'll want a fork in either scenario, so this should be || as suggested by David.

bshah added a comment.Aug 24 2017, 6:02 AM

You committed (... && getuid() != reply) rather than ||. We'll want a fork in either scenario, so this should be || as suggested by David.

Yeah realized that after commiting it, fixed in e72b70a064916310435fa19e0740f376bb687e4c