From a24c5a40dc8c5ae277cd1623afa86b4e7e0dbf19 Mon Sep 17 00:00:00 2001 From: Dwight Engen Date: Wed, 31 Oct 2012 17:08:13 +0100 Subject: [PATCH] Fix lxc-netstat -- argument processing Commit 21e487f2 introduced the use of getopt, but getopt will fail when it sees arguments meant for netstat that are not in [short|long]options. There should not be any ambiguity about arguments with the same letter: those to the left of the -- are destined for lxc-netstat and those to the right for the real netstat, which the original code handles by shifting out all arguments it recognizes before the -- is hit. Signed-off-by: Dwight Engen Signed-off-by: Daniel Lezcano --- src/lxc/lxc-netstat.in | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/lxc/lxc-netstat.in b/src/lxc/lxc-netstat.in index 367568c2e..4abe25f82 100644 --- a/src/lxc/lxc-netstat.in +++ b/src/lxc/lxc-netstat.in @@ -67,19 +67,8 @@ get_parent_cgroup() done } -shortoptions='hn:' -longoptions='help,name:,exec' - -getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@") -if [ $? != 0 ]; then - usage - exit 1; -fi - exec="" -eval set -- "$getopt" - while true; do case $1 in -h|--help) @@ -91,7 +80,7 @@ while true; do --) shift; break;; *) - break; + break;; esac done -- 2.39.5