spaces in pathnames

Roland Mainz roland.mainz at nrubsig.org
Sun Jun 29 19:22:39 PDT 2008


Jeremy Huddleston wrote:
> On Jun 29, 2008, at 18:30, Jeremy Huddleston wrote:
> > So I just pushed a patch to xinit that addresses some issues with
> > spaces in pathnames.  One issue remains, and I'm not sure if there's a
> > clean way to address it.  At first, I thought I could do something
> > like this:
> >
> > -    serverargs=${serverargs}" -auth "${xserverauthfile}
> > +    serverargs=${serverargs}" -auth '"${xserverauthfile}"'"
> >
> > but that doesn't work.  example:
> >
> > $ mya="Some thing with spaces"
> > $ myargs="1 2 '$mya'"
> > $ ./printargs $myargs
> > argv[0] = ./printargs
> > argv[1] = 1
> > argv[2] = 2
> > argv[3] = 'Some
> > argv[4] = thing
> > argv[5] = with
> > argv[6] = spaces'
> >
> > So... any thoughts on how to overcome this cleanly?  And no, telling
> > people to not use spaces is unfortunately not an option... and neither
> > is hitting them over the head with a do-better stick.
> 
> Oh... of course there's this:
> 
> -XINIT "$client" $clientargs -- "$server" $display $serverargs
> +eval XINIT \"$client\" $clientargs -- \"$server\" $display $serverargs
> 
> But is eval available on all the shells that startx should expect to
> work with?

In general: Please avoid using "eval" (see
http://mail.opensolaris.org/pipermail/shell-discuss/2007-June/000993.html
for David Korn's comments on "eval" and
http://www.opensolaris.org/os/project/shell/shellstyle/#avoid_eval_builtin
for the shell style guide... and in genral we try to get "eval" marked
as depreciated with the next revision of the shell language standard) -
it's a constant pain, security risk and source of instabilties if it
isn't used with great care.

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL <currently fluctuating>
 (;O/ \/ \O;)



More information about the xorg mailing list