From 5b76cf02a4a657b2d8d787e82270aa260fd25c13d2e14378ced16a1546c86f15 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 20 Dec 2011 11:08:06 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/procps?expand=0&rev=64 --- procps-3.2.8-procfs-no-perm.patch | 14 ++++++++++++++ procps.changes | 5 +++++ procps.spec | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 procps-3.2.8-procfs-no-perm.patch diff --git a/procps-3.2.8-procfs-no-perm.patch b/procps-3.2.8-procfs-no-perm.patch new file mode 100644 index 0000000..d2651e6 --- /dev/null +++ b/procps-3.2.8-procfs-no-perm.patch @@ -0,0 +1,14 @@ +--- procps-3.2.8/top.c ++++ procps-3.2.8/top.c 2011-12-20 10:49:54.000000000 +0000 +@@ -1147,6 +1147,11 @@ static proc_t **procs_refresh (proc_t ** + else + PT = openproc(flags); + ++ if (PT==NULL) { ++ std_err(strerror(errno)); ++ exit(1); ++ } ++ + // i) Allocated Chunks: *Existing* table; refresh + reuse + if (!(CHKw(Curwin, Show_THREADS))) { + while (curmax < savmax) { diff --git a/procps.changes b/procps.changes index f052253..de4ab17 100644 --- a/procps.changes +++ b/procps.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Dec 20 10:51:18 UTC 2011 - werner@suse.de + +- Avoid segfault with top when /proc is not readable (bnc#733753) + ------------------------------------------------------------------- Tue Nov 22 16:57:06 UTC 2011 - werner@suse.de diff --git a/procps.spec b/procps.spec index 6420540..d1e9f1c 100644 --- a/procps.spec +++ b/procps.spec @@ -79,6 +79,7 @@ Patch40: procps-3.2.8-read-sysctls-also-from-boot-sysctl.conf-kernelversi Patch41: procps-3.2.7-petabytes.patch Patch42: procps-3.2.7-large_pcpu.patch Patch43: procps-3.2.8-tinfo.dif +Patch44: procps-3.2.8-procfs-no-perm.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -150,6 +151,7 @@ Authors: %patch41 -p1 %patch42 -p1 %patch43 +%patch44 -p1 %build make %{?_smp_mflags} CFLAGS="-Wall -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $RPM_OPT_FLAGS -pipe" \