diff options
author | Laura Abbott <labbott@fedoraproject.org> | 2015-09-28 15:39:14 -0700 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2015-09-30 15:17:05 -0300 |
commit | f3f62f5ec3b23823b2ce02e37bc707dc85c56461 (patch) | |
tree | 9935557c289e628e14c497504fcdca000d9206de | |
parent | 50f43ce2f66f02cec44968cac5aa5119ce5cbb81 (diff) | |
download | platform_external_kmod-f3f62f5ec3b23823b2ce02e37bc707dc85c56461.tar.gz platform_external_kmod-f3f62f5ec3b23823b2ce02e37bc707dc85c56461.tar.bz2 platform_external_kmod-f3f62f5ec3b23823b2ce02e37bc707dc85c56461.zip |
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.
-rw-r--r-- | tools/depmod.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/depmod.c b/tools/depmod.c index 348735f..a585d47 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 { |