Bug 365882 - Partition Manager shouldn't allow second instance to run
Summary: Partition Manager shouldn't allow second instance to run
Status: RESOLVED FIXED
Alias: None
Product: partitionmanager
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Andrius Štikonas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-20 02:25 UTC by KDE Neon user
Modified: 2018-03-24 22:27 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description KDE Neon user 2016-07-20 02:25:35 UTC
Users can open two instances of the Partition Manager. There's no use in doing that and it may cause data loss and other issues.

Reproducible: Always

Steps to Reproduce:
1. Open the KDE Partition Manager
2. Keep it open and launch the program again from the start menu (Kickoff).

Actual Results:  
Another instance of the program starts.

Expected Results:  
The current instance/window of the program should be focused.

KDE Partition Manager Version 2.2.1
KDE Neon 5.7 (user edition)
Comment 1 Andrius Štikonas 2016-07-20 11:37:46 UTC
Git commit 71510d270950d05ddda5c81d938db7e5744650bc by Andrius Štikonas.
Committed on 20/07/2016 at 11:36.
Pushed by stikonas into branch 'master'.

Do not allow the second instance of Partition Manager

M  +1    -0    CMakeLists.txt
M  +1    -0    src/CMakeLists.txt
M  +3    -0    src/main.cpp

http://commits.kde.org/partitionmanager/71510d270950d05ddda5c81d938db7e5744650bc
Comment 2 Andrius Štikonas 2016-10-06 17:03:36 UTC
Unfortunately this introduces a regression in Wayland support. I'll revert the commit for now.
Comment 3 Andrius Štikonas 2017-06-12 15:21:22 UTC
(In reply to Andrius Štikonas from comment #2)
> Unfortunately this introduces a regression in Wayland support. I'll revert
> the commit for now.

I investigated this regression a bit. It seems that under wayland we are not able to make a connection to a current user's dbus daemon.

It looks like even setuid does not help in this case (and similar case in kpmcore where we disable plasma automounter, that code also works only on X11).
Comment 4 Andrius Štikonas 2017-06-13 20:41:56 UTC
I don't think it will be possible to use KDBusService as QDBusConnection::sessionBus is not connected on Wayland.

Possibly we will need to register our own dbus interface (basically do what KDBusService::Unique does). Maybe with system bus instead of session bus to make sure that other users can't start the second instance too.
Comment 5 Andrius Štikonas 2018-03-24 22:27:25 UTC
Git commit c40a729ba73ab82bf75fe6c36b977ae17807b75a by Andrius Štikonas.
Committed on 24/03/2018 at 22:26.
Pushed by stikonas into branch 'kauth'.

Do not allow the second instance of Partition Manager.

M  +1    -0    CMakeLists.txt
M  +1    -0    src/CMakeLists.txt
M  +3    -0    src/main.cpp

https://commits.kde.org/partitionmanager/c40a729ba73ab82bf75fe6c36b977ae17807b75a