Hello community,
here is the log from the commit of package kexec-tools
checked in at Thu Apr 19 21:48:02 CEST 2007.
--------
--- kexec-tools/kexec-tools.changes 2007-04-13 13:56:45.000000000 +0200
+++ /mounts/work_src_done/STABLE/kexec-tools/kexec-tools.changes 2007-04-19 11:58:41.000000000 +0200
@@ -1,0 +2,10 @@
+Thu Apr 19 10:55:31 CEST 2007 - bwalle@suse.de
+
+- fixes in kdump-helper (update to 0.1.2):
+ o retrieve the disk size before mmap()
+ o return GENERAL_ERROR if the program cannot be opened
+ o use symbolic constants for exit values instead of magic numbers
+ now consistently
+ o check for correct return value of mmap() instead of NULL
+
+-------------------------------------------------------------------
Old:
----
kdump-helper-0.1.1.tar.bz2
New:
----
kdump-helper-0.1.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kexec-tools.spec ++++++
--- /var/tmp/diff_new_pack.p28608/_old 2007-04-19 21:47:25.000000000 +0200
+++ /var/tmp/diff_new_pack.p28608/_new 2007-04-19 21:47:25.000000000 +0200
@@ -11,7 +11,7 @@
# norootforbuild
Name: kexec-tools
-%define helperversion 0.1.1
+%define helperversion 0.1.2
%define package_version testing-20070319-rc
License: GNU General Public License (GPL)
Group: System/Kernel
@@ -19,7 +19,7 @@
Autoreqprov: on
Summary: Tools for fast kernel loading
Version: 1.101
-Release: 92
+Release: 93
Source: %{name}-%{package_version}.tar.bz2
Source1: kdump
Source2: sysconfig.kdump
@@ -124,6 +124,13 @@
%{_sbindir}/kdump-helper
%changelog
+* Thu Apr 19 2007 - bwalle@suse.de
+- fixes in kdump-helper (update to 0.1.2):
+ o retrieve the disk size before mmap()
+ o return GENERAL_ERROR if the program cannot be opened
+ o use symbolic constants for exit values instead of magic numbers
+ now consistently
+ o check for correct return value of mmap() instead of NULL
* Fri Apr 13 2007 - bwalle@suse.de
- improved documentation of KDUMP_DUMPDEV (#264050)
* Mon Apr 02 2007 - rguenther@suse.de
++++++ kdump-helper-0.1.1.tar.bz2 -> kdump-helper-0.1.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helper-0.1.1/ChangeLog new/kdump-helper-0.1.2/ChangeLog
--- old/kdump-helper-0.1.1/ChangeLog 2007-02-09 11:12:46.000000000 +0100
+++ new/kdump-helper-0.1.2/ChangeLog 2007-04-19 11:14:50.000000000 +0200
@@ -1,14 +1,22 @@
+2007-04-19 Bernhard Walle
+
+ * retrieve the disk size before mmap()
+ * return GENERAL_ERROR if the program cannot be opened
+ * use symbolic constants for exit values instead of magic numbers
+ now consistently
+ * check for correct return value of mmap() instead of NULL
+
2007-02-09 Bernhard Walle
- - fixed overflow error that prints the size from being
+ * fixed overflow error that prints the size from being
printed correctly if the size doesn't fit into an int
2007-01-16 Bernhard Walle
- - don't use elf_begin because that maps the whole core file,
+ * don't use elf_begin because that maps the whole core file,
instead do the mmap() in the program and pass a memory
pointer to libelf
2007-01-15 Bernhard Walle
- - initial package
+ * initial package
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helper-0.1.1/kdump-helper.c new/kdump-helper-0.1.2/kdump-helper.c
--- old/kdump-helper-0.1.1/kdump-helper.c 2007-02-09 11:12:46.000000000 +0100
+++ new/kdump-helper-0.1.2/kdump-helper.c 2007-04-19 11:22:10.000000000 +0200
@@ -26,6 +26,8 @@
#include
#include
#include
+#include
+#include
#include
#include
@@ -95,21 +97,21 @@
case 'h':
print_usage();
- exit(0);
+ exit(SUCCESS);
case 'v':
print_version();
- exit(0);
+ exit(SUCCESS);
default:
print_usage();
- exit(1);
+ exit(GENERAL_ERROR);
}
}
if (optind != argc - 1) {
fprintf(stderr, "No filename specified\n");
- exit(1);
+ exit(GENERAL_ERROR);
}
strncpy(s_filename, argv[optind], PATH_MAX);
@@ -119,13 +121,27 @@
int open_dump(int fd)
{
GElf_Ehdr elfhdr;
+ unsigned long numblocks;
+ int ret;
s_map = mmap(NULL, ELF_HEADER_MAPSIZE, PROT_READ, MAP_PRIVATE, fd, 0);
- if (!s_map) {
+ if (s_map == MAP_FAILED) {
perror("Unable to do mapping");
return GENERAL_ERROR;
}
+ /* check if the size is appropriate for mapping */
+ ret = ioctl(fd, BLKGETSIZE, &numblocks);
+ if (ret < 0) {
+ perror("Unable to call ioctl(BLKGETSIZE)");
+ return GENERAL_ERROR;
+ }
+
+ if (((unsigned long long)numblocks * 512) < ELF_HEADER_MAPSIZE) {
+ fprintf(stderr, "Disk too small\n");
+ return GENERAL_ERROR;
+ }
+
s_elf = elf_memory(s_map, ELF_HEADER_MAPSIZE);
if (!s_elf)
return WRONG_DUMP;
@@ -204,20 +220,20 @@
if (elf_version(EV_CURRENT) == EV_NONE ) {
/* library out of date */
fprintf(stderr, "Elf library out of date!\n");
- exit(-1);
+ return GENERAL_ERROR;
}
/* open ELF library */
fd = open(argv[optind], O_RDONLY);
if (fd < 0) {
perror("Could not open dump file");
- goto end;
+ return GENERAL_ERROR;
}
ret = open_dump(fd);
if (ret != 0) {
printf("Not a valid dump\n");
- exit(ret);
+ return GENERAL_ERROR;
} else if (s_check_dump) {
printf("Valid dump\n");
}
@@ -236,7 +252,7 @@
close_dump();
close(fd);
- return 0;
+ return SUCCESS;
}
/* vim: set ts=4 sw=4 et: */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helper-0.1.1/.version new/kdump-helper-0.1.2/.version
--- old/kdump-helper-0.1.1/.version 2007-02-09 11:12:46.000000000 +0100
+++ new/kdump-helper-0.1.2/.version 2007-04-19 10:54:22.000000000 +0200
@@ -1 +1 @@
-0.1.1
\ No newline at end of file
+0.1.2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org