Clarify the xdg-su man page
Submitted by Francois Gouget
Assigned to Portland Bugs
Description
Created attachment 71040 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.
Attachment 71040, "Better check the -u and -c options and document -c":
xdg-su.diff
Version: beta2