Bug 355194

Summary: xdg-open once set keeps persistently first in Application Preference Order
Product: [Applications] dolphin Reporter: Pavel Mendl <pavel_mendl>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: crash CC: rdieter
Priority: NOR    
Version First Reported In: 16.12.2   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Pavel Mendl 2015-11-11 15:39:44 UTC
Configuring xdg-open as the primary (default) application to open some file type (as I did in hope this will restore "normal" processing of respective .desktop files, mistakenly associating them with Kate before) leads to dangerous behavior, where unkillable xdg-open proces gets started, who's population even grows with each kill attempt (see Actual Results for details).
The configuration keeps persistent, resistent to both Delete and Move down actions.



Reproducible: Always

Steps to Reproduce:
1) Choose some type of files (URL link . desktop file in my case), find file of this type in Dolphin. 
2) Right click the file, choose Properties
3) Click "File type options" button in the frame that opens
4) In Application Preference Order part click "Add" button.
5) Fill-in xdg-open for application 
6) (Maybe not necessary) make xdg-open item first (top) in the list)
7) Click Apply or OK.

Actual Results:  
A) Now clicking (left = normal) the file of this type opens long-lasting application starting indicator, with no other visible clue. However, running "ps -A | grep xdg-open" (or Ctrll-Esc process list) will show one xdg-open process running.
B) Each attempt to kill the process (either killall xdg-open or kill by process ID) leads to TWO (!!!) xdg-open processes running (with different IDs than the original one). Can be repeated indifinetly (until system crashes); xdg-open processes grows like Hydra's heads.
C) There is no way to remove or at least lower priority of xdg-open in the list. Both "Remove" and "Move down" buttons in the Application Preference Order part seemingly does what epected, however after pressing either OK or Apply you can find xdg-open again as the first item in the list.

Expected Results:  
A) With xdg-open present the .desktop file should be normally interpreted, e.g. in the cas it contains URL link it should open the link in the default browser.
B) "Remove" and "Move down" should handle xdg-open item in the list of application same way as they do with any other application.

Set severity to Crash even if the crash is not immediate, because of dangerousness of the self-populating, unkillable xdg-open processes.
Comment 1 Pavel Mendl 2015-11-11 16:06:01 UTC
Found workaround myself:
in the $HOME/.config/mimeapps.list file both under [Added Associations] and [Default Applications] there appeared line:
application/x-desktop=xdg-open.desktop;

Two (!) steps required:
1) Remove the above mentioned lines in text editor
2) Through Dolphin remove the xdg-open application from the list. (It is still there, however now Delet button works).

Still the issue is worth of fix.
Comment 2 Rex Dieter 2015-11-12 14:06:20 UTC
This is one of those cases where the best advice is: don't do that

Longer story: setting xdg-open as a mime-handler in itself, is bad... because it doesn't actually handle things itself, but serves as a proxy to other mime-handling apps, and risks recursion (which may have happened here).