Bug 57921

Summary: Clarify the xdg-su man page
Product: Portland Reporter: Francois Gouget <fgouget>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: beta2   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Better check the -u and -c options and document -c

Description Francois Gouget 2012-12-05 19:19:33 UTC
Created attachment 71040 [details]
Better check the -u and -c options and document -c

The xdg-su man page says:

>  xdg-su [-u user] -c command
>
>  xdg-su provides a graphical dialog that prompts the user for a
>  password to run command as user or as root if no user was specified.

The '-c' option is not documented and this does not clearly say if one should use 'xdg-su -c echo HelloWorld' or 'xdg-su -c "echo HelloWorld"'.

The example at the end of the page seems to imply the latter but then it's only one example and one may think that a second example could show that the other option is valid too.

>  xdg-su -u root -c "/opt/shinythings/bin/install-GUI --install fast"


I'll further note that the situation is muddied by the fact that

  xdg-su -c sh -c 'echo HelloWorld'

is equivalent to

  xdg-su -c foo -c 'echo HelloWorld'

and to

  xdg-su -c 'echo HelloWorld'

due to the limited parameter checking.


I'm attaching a patch as a starting point for a fix.
Comment 1 Francois Gouget 2012-12-05 19:22:17 UTC
One more note, I ran into with:

xdg-utils-1.0.2-93.1.noarch on SUSE 11.4 (xdg-su 1.0beta2)
Comment 2 Francois Gouget 2012-12-05 19:27:32 UTC
I have now checked that the issue is still present in the current Git tip (050333e3).
Comment 3 Francois Gouget 2015-12-07 10:17:57 UTC
This bug is still present in b110b355 (2015/11/12).
So any news on this?
It has been three years and it looks like no progress was made...
Comment 4 GitLab Migration User 2019-02-16 13:35:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/62.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.