|
|
87528e |
From 1f5010924500a4fd83047584d1fbdba5517dffa2 Mon Sep 17 00:00:00 2001
|
|
|
87528e |
From: Tony Camuso <tcamuso@redhat.com>
|
|
|
87528e |
Date: Fri, 24 Jun 2016 12:37:48 -0400
|
|
|
87528e |
Subject: [RHEL-7.3 PATCH 1/3] depmod: Don't fall back to uname on bad version
|
|
|
87528e |
|
|
|
87528e |
Cherry-picked without conflicts from the following upstream commit.
|
|
|
87528e |
|
|
|
87528e |
commit f3f62f5ec3b23823b2ce02e37bc707dc85c56461
|
|
|
87528e |
Author: Laura Abbott <labbott@fedoraproject.org>
|
|
|
87528e |
Date: Mon Sep 28 15:39:14 2015 -0700
|
|
|
87528e |
|
|
|
87528e |
depmod: Don't fall back to uname on bad version
|
|
|
87528e |
|
|
|
87528e |
Currently, if a value that doesn't match a kernel version
|
|
|
87528e |
("%u.%u") is passed in, depmod silently falls back to
|
|
|
87528e |
using uname. Rather than try and work around the caller passing
|
|
|
87528e |
bad data, just exit out instead.
|
|
|
87528e |
|
|
|
87528e |
Signed-off-by: Tony Camuso <tcamuso@redhat.com>
|
|
|
87528e |
---
|
|
|
87528e |
tools/depmod.c | 6 +++++-
|
|
|
87528e |
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
87528e |
|
|
|
87528e |
diff --git a/tools/depmod.c b/tools/depmod.c
|
|
|
87528e |
index 231b9ab..8d5c671 100644
|
|
|
87528e |
--- a/tools/depmod.c
|
|
|
87528e |
+++ b/tools/depmod.c
|
|
|
87528e |
@@ -2475,7 +2475,11 @@ static int do_depmod(int argc, char *argv[])
|
|
|
87528e |
}
|
|
|
87528e |
}
|
|
|
87528e |
|
|
|
87528e |
- if (optind < argc && is_version_number(argv[optind])) {
|
|
|
87528e |
+ if (optind < argc) {
|
|
|
87528e |
+ if (!is_version_number(argv[optind])) {
|
|
|
87528e |
+ ERR("Bad version passed %s\n", argv[optind]);
|
|
|
87528e |
+ goto cmdline_failed;
|
|
|
87528e |
+ }
|
|
|
87528e |
cfg.kversion = argv[optind];
|
|
|
87528e |
optind++;
|
|
|
87528e |
} else {
|
|
|
87528e |
--
|
|
|
87528e |
1.8.3.1
|
|
|
87528e |
|