On Wed, 15 May 2013, Serge Hallyn wrote:

> > > Soon analogous create and destroy hooks will be added as well.
> >
> > I think I'd have preferred storing the command arguments in
> > LXC_CLONE_ARGS instead of directly in argv. Doing so would allow us to
> > remove/add other arguments without breaking all existing hooks.
> >
> > The user could then do "set -- $LXC_CLONE_ARGS" and just use $1... as usual.
> >
> > But I'm not horribly opposed to the proposed implementation and the rest
> > looks good.
>
> Actually,
>
> yeah that would let menot add the argv[] to run_lxc_hooks, and make the
> patch quite a bit shorter.
>
> I'll redo it like that.

I'd really prefer proper arguments.
In argv you have null terminated strings, a proper array.

In "LXC_CLONE_ARGS" you have to encode the null terminated string in some
way, forcing the comsumer to unencode it.
Ie,
  set -- $LXC_CLONE_ARGS
which is actually insufficient.
In order to avoid shell expansion, the user has to do something like this:
 eval set -- "${LXC_CLONE_ARGS}"

and you'll have to shell escape the content that you put in there.

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to