From ef2366cdca45941f943f4970ac57a4008181fca9 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 12 Dec 2020 08:44:32 +0100 Subject: nsenter: stop option parsing on 1st non-option "nsenter ls -l" gives: invalid option -- 'l' Signed-off-by: Denys Vlasenko --- util-linux/nsenter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util-linux') diff --git a/util-linux/nsenter.c b/util-linux/nsenter.c index c48dcf885..9cfbf21e4 100644 --- a/util-linux/nsenter.c +++ b/util-linux/nsenter.c @@ -103,8 +103,9 @@ static const struct namespace_descr ns_list[] = { }; /* * Upstream nsenter doesn't support the short option for --preserve-credentials + * "+": stop on first non-option */ -static const char opt_str[] ALIGN1 = "U::i::u::n::p::m::""t:+S:+G:+r::w::F"; +static const char opt_str[] ALIGN1 = "+""U::i::u::n::p::m::""t:+S:+G:+r::w::F"; #if ENABLE_LONG_OPTS static const char nsenter_longopts[] ALIGN1 = -- cgit v1.2.3