From: Laura Abbott Date: Mon, 28 Sep 2015 22:39:14 +0000 (-0700) Subject: depmod: Don't fall back to uname on bad version X-Git-Tag: v22~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f3f62f5ec3b23823b2ce02e37bc707dc85c56461;p=thirdparty%2Fkmod.git depmod: Don't fall back to uname on bad version Currently, if a value that doesn't match a kernel version ("%u.%u") is passed in, depmod silently falls back to using uname. Rather than try and work around the caller passing bad data, just exit out instead. --- diff --git a/tools/depmod.c b/tools/depmod.c index 348735f9..a585d475 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -2476,7 +2476,11 @@ static int do_depmod(int argc, char *argv[]) } } - if (optind < argc && is_version_number(argv[optind])) { + if (optind < argc) { + if (!is_version_number(argv[optind])) { + ERR("Bad version passed %s\n", argv[optind]); + goto cmdline_failed; + } cfg.kversion = argv[optind]; optind++; } else {