From: Paul Asmuth Date: Fri, 9 Nov 2018 16:02:11 +0000 (+0100) Subject: fix a bug where switch_root would erroneously try to parse initargs X-Git-Tag: v2.33.1~30 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Futil-linux.git;a=commitdiff_plain;h=831fc7b7eef226b11c8b36bc8e3adba16b65e98f fix a bug where switch_root would erroneously try to parse initargs before this change, switch_root would try to parse all arguments, including 'initargs', using getopt, which would lead to an 'unrecognized option' error when trying to pass a flag to the init program --- diff --git a/sys-utils/switch_root.c b/sys-utils/switch_root.c index 3c66d01867..a85ce24b93 100644 --- a/sys-utils/switch_root.c +++ b/sys-utils/switch_root.c @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) atexit(close_stdout); - while ((c = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1) + while ((c = getopt_long(argc, argv, "+Vh", longopts, NULL)) != -1) switch (c) { case 'V': printf(UTIL_LINUX_VERSION);