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'
xdg-su -c 'echo HelloWorld'
due to the limited parameter checking.
I'm attaching a patch as a starting point for a fix.
One more note, I ran into with:
xdg-utils-1.0.2-93.1.noarch on SUSE 11.4 (xdg-su 1.0beta2)
I have now checked that the issue is still present in the current Git tip (050333e3).
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...
-- 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.