nsenter: stop option parsing on 1st non-option

"nsenter ls -l" gives: invalid option -- 'l'

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2020-12-12 08:44:32 +01:00
parent 030fe31760
commit ef2366cdca
2 changed files with 3 additions and 2 deletions

View File

@ -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 =