[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dchroot scripts



Kyle Rose <krose@krose.org> writes:

> So, the dchroot wrapper script suggestion in the FAQ is okay, but it
> doesn't really work in all cases because dchroot appears to sh -c
> ... without doing proper quoting on the underlying command.  Commands
> like
>
>   mplayer 'rtsp://1.2.3.4:5678/encoder/listen.rm?cloakport=8080'
>
> would choke because the shell would try to glob for ? and fail.

There are actually two separate problems with quoting in dchroot, and
they're both caused by interaction with su:

Bug #249655: "dchroot -d ls -l" broken: su tries to interpret -l switch
* dchroot doesn't call su with -- before the command, so su tries to
  interpret anything in the command that looks like one of it's options.

Bug #276419: su appends the positional args to the command line
* Using su username command arg1 arg2, su calls sh -c with the string
  "command arg1 arg2" using execv, instead of execvp. So spaces, etc.
  screw you up. If it used execvp, you wouldn't have to do the quoting.

I was swearing at dchroot yesterday, and came up with my own fix
(using python), although I patched dchroot to fix the first issue.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca



Reply to: