[procps/f14/master] constructor order fix, make fix, merged selinux patches
Jan Görig
jgorig at fedoraproject.org
Thu Sep 23 16:29:22 UTC 2010
commit 4030c2042f1bdc20aa41b8e8b5e596166b97a59d
Author: Jan Görig <jgorig at redhat.com>
Date: Thu Sep 23 18:24:58 2010 +0200
constructor order fix, make fix, merged selinux patches
procps-3.2.7-libselinux.patch | 61 ---------------------
procps-3.2.7-ps-libselinux.patch | 11 ----
procps-3.2.7-selinux-workaround.patch | 14 -----
procps-3.2.7-selinux.patch | 23 --------
procps-3.2.8-constructor-order.patch | 38 +++++++++++++
procps-3.2.8-selinux.patch | 96 +++++++++++++++++++++++++++++++++
procps.spec | 19 +++----
7 files changed, 143 insertions(+), 119 deletions(-)
---
diff --git a/procps-3.2.8-constructor-order.patch b/procps-3.2.8-constructor-order.patch
new file mode 100644
index 0000000..87b5a03
--- /dev/null
+++ b/procps-3.2.8-constructor-order.patch
@@ -0,0 +1,38 @@
+Description: Call libproc constructors in strict order
+ Having one constructor depend on another means if the order is reversed
+ you get a different result. Patched based on idea by Tom Evans.
+Bug-Debian: http://bugs.debian.org/460331
+Author: Craig Small <csmall at debian.org>
+Adapted to Fedora: Jan Görig <jgorig at redhat.com>
+--- a/proc/sysinfo.c
++++ b/proc/sysinfo.c
+@@ -213,6 +213,7 @@
+ static void init_libproc(void) __attribute__((constructor));
+ static void init_libproc(void){
+ have_privs = check_for_privs();
++ init_Linux_version(); /* Must be called before we check code */
+ // ought to count CPUs in /proc/stat instead of relying
+ // on glibc, which foolishly tries to parse /proc/cpuinfo
+ //
+--- a/proc/version.c
++++ b/proc/version.c
+@@ -33,8 +33,7 @@
+
+ int linux_version_code;
+
+-static void init_Linux_version(void) __attribute__((constructor));
+-static void init_Linux_version(void) {
++void init_Linux_version(void) {
+ static struct utsname uts;
+ int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */
+
+--- a/proc/version.h
++++ b/proc/version.h
+@@ -14,6 +14,7 @@
+
+ EXTERN_C_BEGIN
+
++void init_Linux_version(void); /* Get Linux version */
+ extern void display_version(void); /* display suite version */
+ extern const char procps_version[]; /* global buf for suite version */
+ extern const char procps_number_version[]; /* global buf for suite number version */
diff --git a/procps-3.2.8-selinux.patch b/procps-3.2.8-selinux.patch
new file mode 100644
index 0000000..a8c1f74
--- /dev/null
+++ b/procps-3.2.8-selinux.patch
@@ -0,0 +1,96 @@
+diff --git a/Makefile b/Makefile
+index 09fb3ed..4d05900 100644
+--- a/Makefile
++++ b/Makefile
+@@ -73,12 +73,12 @@ CURSES := -lncurses
+ # Something like this is probably needed to make the SE Linux
+ # library loading not conflict with embedded systems stuff.
+ #
+-#ifeq ($(SHARED),1)
+-#ldl := -ldl
+-#LIBTYPE := -DSHAREDLIB
+-#else
+-#LIBTYPE := -DSTATICLIB
+-#endif
++ifeq ($(SHARED),1)
++ldl := -ldl
++LIBTYPE := -DSHAREDLIB
++else
++LIBTYPE := -DSTATICLIB
++endif
+
+ # Preprocessor flags.
+ PKG_CPPFLAGS := -D_GNU_SOURCE -I proc
+@@ -103,7 +103,7 @@ PKG_CFLAGS := -fno-common -ffast-math \
+ # Note that some stuff below is conditional on CFLAGS containing
+ # an option that starts with "-g". (-g, -g2, -g3, -ggdb, etc.)
+ CFLAGS := -O2 -s
+-ALL_CFLAGS := $(PKG_CFLAGS) $(CFLAGS)
++ALL_CFLAGS := $(PKG_CFLAGS) $(CFLAGS) $(LIBTYPE)
+
+ PKG_LDFLAGS := -Wl,-warn-common
+ LDFLAGS :=
+diff --git a/ps/output.c b/ps/output.c
+index 87bf9de..edbb4cb 100644
+--- a/ps/output.c
++++ b/ps/output.c
+@@ -1099,7 +1099,7 @@ static int pr_sgi_p(char *restrict const outbuf, const proc_t *restrict const pp
+ return snprintf(outbuf, COLWID, "*");
+ }
+
+-
++#ifdef STATICLIB
+ /****************** FLASK & seLinux security stuff **********************/
+ // move the bulk of this to libproc sometime
+
+@@ -1131,7 +1131,7 @@ fail:
+ return 1;
+ }
+
+-#if 0
++#else
+ // This needs more study, considering:
+ // 1. the static linking option (maybe disable this in that case)
+ // 2. the -z and -Z option issue
+diff --git a/ps/parser.c b/ps/parser.c
+index 5ad9035..2659d4d 100644
+--- a/ps/parser.c
++++ b/ps/parser.c
+@@ -231,7 +231,7 @@ static const char *parse_sysv_option(void){
+ // In the meantime, please do not add to it. The list is
+ // intended to ONLY contain flags defined by the POSIX and UNIX
+ // standards published by The Open Group, IEEE, and ISO.
+- if(!strchr("aAdefgGlnoptuU", *flagptr)) not_pure_unix = 1; // dude, -Z ain't in POSIX
++ if(!strchr("aAdefgGlnoptuUZ", *flagptr)) not_pure_unix = 1; // dude, -Z ain't in POSIX
+
+ switch(*flagptr){
+ case 'A':
+diff --git a/ps/ps.1 b/ps/ps.1
+index 64953d5..aab2584 100644
+--- a/ps/ps.1
++++ b/ps/ps.1
+@@ -450,6 +450,9 @@ display virtual memory format
+ Do not show flags; show rss in place of addr.
+ This option can only be used with \fB\-l\fR.
+
++.opt \-Z
++display security context format (SELinux, etc.)
++
+ .opt \-\-format \ format
+ user\-defined format. Identical to \fB\-o\fR and \fBo\fR.
+
+diff --git a/w.c b/w.c
+index 1b2a0fc..207a8a1 100644
+--- a/w.c
++++ b/w.c
+@@ -163,6 +163,10 @@ static const proc_t *getproc(const utmp_t *restrict const u, const char *restric
+ if(best && tmp->start_time <= best->start_time) continue;
+ best = tmp;
+ }
++ /* It is there but SELinux wouldn't allow us to know the detail. Really
++ w should just be given rights */
++ if(!kill(u->ut_pid, 0) || errno != ESRCH)
++ *found_utpid = 1;
+ return best ? best : secondbest;
+ }
+
diff --git a/procps.spec b/procps.spec
index c8a6012..de379ff 100644
--- a/procps.spec
+++ b/procps.spec
@@ -1,7 +1,7 @@
Summary: System and process monitoring utilities
Name: procps
Version: 3.2.8
-Release: 11%{?dist}
+Release: 12%{?dist}
License: GPLv2+ and LGPLv2+
Group: Applications/System
URL: http://procps.sourceforge.net
@@ -12,10 +12,9 @@ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
-Patch1: procps-3.2.7-selinux.patch
+Patch1: procps-3.2.8-selinux.patch
Patch2: procps-3.2.7-misc.patch
Patch3: procps-3.2.7-FAQ.patch
-Patch4: procps-3.2.7-selinux-workaround.patch
Patch6: procps-3.2.7-noproc.patch
Patch7: procps-3.2.7-pseudo.patch
Patch8: procps-3.2.7-0x9b.patch
@@ -26,8 +25,6 @@ Patch10: procps-3.2.7-top-rc.patch
# 161303 - 'top' failed when remove cpus
# 186017 - Top "Cpu0" line never updates on single processor machine
Patch11: procps-3.2.7-top-remcpu.patch
-# Selinux
-Patch12: procps-3.2.7-libselinux.patch
# 177453 - for VIRT use proc->vm_size rather then proc->size (workaround)
Patch14: procps-3.2.7-top-env-vmsize.patch
# 174619 - workaround for reliable Cpu(s) data in the first loop
@@ -53,8 +50,6 @@ Patch26: procps-3.2.7-ps-stime.patch
Patch28: procps-3.2.7-ps-eip64.patch
#244960 - ps manpage formatted incorrectly
Patch29: procps-3.2.7-psman.patch
-#255441 - ldopen libselinux.so.1 instead of libselinux.so
-Patch30: procps-3.2.7-ps-libselinux.patch
#185994 - error when using "Single Cpu = Off" option
Patch31: procps-3.2.7-top-cpu0.patch
#354001 - CPU value in top is reported as an integer
@@ -96,6 +91,8 @@ Patch48: procps-3.2.8-vmstat-getopt.patch
Patch49: procps-3.2.8-ps-cgroup-suppress-root-group.patch
#631340 - fixed build with make 3.82
Patch50: procps-3.2.8-make.patch
+#632236: don't depend on constructor execution order
+Patch51: procps-3.2.8-constructor-order.patch
BuildRequires: ncurses-devel
@@ -126,14 +123,12 @@ working directory of a process or processes.
%patch1 -p1
%patch2 -p1
%patch3 -p1
-%patch4 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
-%patch12 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
@@ -146,7 +141,6 @@ working directory of a process or processes.
%patch26 -p1
%patch28 -p1
%patch29 -p1
-%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
@@ -167,6 +161,7 @@ working directory of a process or processes.
%patch48 -p1
%patch49 -p1
%patch50 -p1
+%patch51 -p1
cp %SOURCE1 .
@@ -204,6 +199,10 @@ rm -rf %{buildroot}
%attr(0644,root,root) %{_mandir}/man5/*
%changelog
+* Thu Sep 23 2010 Jan Görig <jgorig at redhat.com> 3.2.8-12
+- merged selinux patches into procps-3.2.7-selinux.patch
+- fixed #632236 - don't depend on constructor execution order
+
* Wed Sep 8 2010 Jan Görig <jgorig at redhat.com> 3.2.8-11
- fixed build with make 3.82
More information about the scm-commits
mailing list