[lxc-devel] Possible bug in lxc-netstat w/ patch; feature patch

Serge Hallyn serge.hallyn at ubuntu.com
Thu Jun 27 13:03:44 UTC 2013


Quoting Andrew Gilbert (andrewg800 at gmail.com):
> Regarding the second patch, my thought is that if a user forgets the
> '--', the current behaviour will either crash as described in my bug
> report, or try to use the following arguments as the name of the
> container to open. That is, I believe that
> 
>         lxc-netstat -n <container-name> -n -a
> 
> will result in trying to do netstat on container "-a". I think my
> patch brings lxc-netstat's behaviour into a more consistent form,
> given that it seems
> 
>         lxc-netstat -n <container-name> -a -n
> 
> will result in calling netstat on container-name with "-a -n" as the
> arguments (see the last line of the case statement; line 81 of the
> unpatched source). The behaviour currently depends on the order of
> the arguments, as far as I can tell.
> 
> Perhaps a better approach would be to consistently die cleanly if no
> -- is provided, unless there are no further arguments? Or maybe it
> doesn't matter if behaviour is undefined under these circumstances.

Ok - I don't like implied semantics in general, but since lxc-netstat
itself *only* accepts a -n, your patch does seem best.

Thanks!




More information about the lxc-devel mailing list