Bug 2595 - startx arg handling is not whitespace-clean
Summary: startx arg handling is not whitespace-clean
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: App/xinit (show other bugs)
Version: 6.8.0
Hardware: All Linux (All)
: high normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: http://bugs.gentoo.org/show_bug.cgi?i...
Whiteboard: 2011BRB_Reviewed
Keywords: love
Depends on:
Blocks:
 
Reported: 2005-02-22 12:49 UTC by Jason Bucata
Modified: 2018-06-12 19:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
patch to startx (1.83 KB, patch)
2005-02-22 12:53 UTC, Jason Bucata
no flags Details | Splinter Review

Description Jason Bucata 2005-02-22 12:49:34 UTC
Taking upstream at request of Gentoo devs.

According to the man page, startx is supposed to take the same command-line
syntax as xinit, and provide some extra services like setting up authorization
and such like.  However, xinit handles single-quoted command line args with
embedded spaces correctly, but startx does not.

The script assumes that each individual command-line parameter has no embedded
spaces, with constructs like:
     clientargs="$clientargs $1"
Thus, any special quoting or grouping on the startx command line won't get
propagated to xinit correctly.

I discovered this problem while trying to do some testing for another bug. 
Boiled down, this command works:
     xinit /bin/sh -vxc 'xsetroot -solid orange; sleep 5' -- :1
but this command, which per the docs should work, doesn't:
     startx /bin/sh -vxc 'xsetroot -solid orange; sleep 5' -- :1
The former starts the server, sets the background color and waits for 5 seconds,
like it should.  The latter starts the server and bails immediately since
xsetroot runs with no args and sleep isn't run at all.

I used a little sed command that I hope is adequate to quote for whatever shells
you intend to support as /bin/sh.  Will upload patch.
Comment 1 Jason Bucata 2005-02-22 12:53:22 UTC
Created attachment 1960 [details] [review]
patch to startx
Comment 2 Daniel Stone 2007-02-27 01:25:32 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 3 Martin Mokrejs 2009-01-30 12:14:56 UTC
Confirming the patch is still necessary and helpful on Gentoo linux with x11-apps/xinit-1.0.8-r3.
Comment 4 Adam Jackson 2018-06-12 19:06:32 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.


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.