Bug 133942

Summary: gnome-desktop incorrectly launches gnomesu when Exec entry has params
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Scott Reeves <sreeves>
Component: GNOMEAssignee: Stanislav Brabec <sbrabec>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Exec entry with params patch

Description Scott Reeves 2005-11-16 00:15:57 UTC
We currently patch gnome-desktop/libgnome-desktop/gnome-desktop-item.c to launch gnomesu with the Exec entry from the .desktop file if the .desktop file needs additional rights. However if the Exec entry has params we don't generate the command line to gnomesu correctly and it fails. Launch /usr/share/applications/YaST2/users.desktop for example.
Comment 1 Scott Reeves 2005-11-16 00:41:36 UTC
Created attachment 57430 [details]
Exec entry with params patch
Comment 2 Scott Reeves 2005-11-16 00:44:43 UTC
Hi Stanislav Brabec,

It appears from the gnome-desktop.changes file that you own the X-KDE-SubstituteUID.dif file that prepends the gnomesu onto the Exec entry.  I am not very familiar with the internals of gnome-desktop and would like your opinion on which would be the better solution so I am temporarily assigning this to you for your input.

1. Prepend a -c before the quoted Exec entry
2. Don't enclose the command line in quotes.

I have tried launching the mentioned users.desktop file both ways and they both seem to work.  Attached is the modified patch using solution 1.
Comment 3 Stanislav Brabec 2005-11-16 13:51:32 UTC
This is not my patch. I have only changed kdesu to gnomesu, but well:

3. Don't enclose the command line in quotes. and prepend a -- before the exec entry.

It will prevent problems with quoted arguments and --arguments.

Please compare:

1) broken: gnomesu -c "/sbin/yast2 "a b" --sw_single"

2) broken: gnomesu "/sbin/yast2 "a b" --sw_single"

3) works: gnomesu -- /sbin/yast2 "a b" --sw_single
Comment 4 Stanislav Brabec 2005-11-16 13:55:15 UTC
Fixed patch submitted for STABLE. I did not yet tested it, but I hope that it works.
Comment 5 Stanislav Brabec 2005-11-16 14:32:02 UTC
Tested with users.desktop and it seems to work.