Two small issues in is_compressed_kernel()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When I was using crash 5.1.4, I found two small issues in
is_compressed_kernel().

1) For vmlinux compressed with bzip2, is_compressed_kernel() is
forgetting to use basename() to a given file name before comparing it
with "vmlinux", due to which specifying vmlinux by relative or
absolute path lets a given vmlinux unintensionally interpreted as an
unsuported format. See an attached patch, though it's very obvious.

2) is_compressed_kernel() is assuming gunzip and bunzip2 are located
in /usr/bin/, but on Ubuntu they are located in /bin/, so
uncompression fails on Ubuntu due to No such file error. Could you add
a static or dynamic processing of detecting where binaries are
located?

Thanks.
HATAYAMA, Daisuke
>From 4d09ad91ff6bb9267929cd8a1f413ddadddc5e54 Mon Sep 17 00:00:00 2001
From: HATAYAMA Daisuke <d.hatayama@xxxxxxxxxxxxxx>
Date: Mon, 4 Apr 2011 12:54:05 +0900
Subject: [PATCH] Use basename() to compare a given vmlinux name with "vmlinux"

---
 symbols.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/symbols.c b/symbols.c
index 29cb4b4..9a52d07 100755
--- a/symbols.c
+++ b/symbols.c
@@ -2997,7 +2997,7 @@ is_compressed_kernel(char *file, char **tmp)
 	}
 
 	if ((header[0] == 'B') && (header[1] == 'Z') && (header[2] == 'h')) {
-		if (!STRNEQ(file, "vmlinux") && 
+		if (!STRNEQ(basename(file), "vmlinux") &&
 		    !(st->flags & FORCE_DEBUGINFO)) {
 			error(INFO, "%s: compressed file name does not start "
 			    "with \"vmlinux\"\n", file);
-- 
1.7.4

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux