updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / selinux-procps / procps-3.2.8-selinux.patch
blob15d461270c66591566c77bc4f7a8c77c79c08736
1 diff -aur procps-3.2.8.pristine//Makefile procps-3.2.8.new//Makefile
2 --- procps-3.2.8.pristine//Makefile 2010-07-23 15:45:52.829554761 +0200
3 +++ procps-3.2.8.new//Makefile 2010-07-23 15:48:55.956206700 +0200
4 @@ -73,17 +73,17 @@
5 # Something like this is probably needed to make the SE Linux
6 # library loading not conflict with embedded systems stuff.
8 -#ifeq ($(SHARED),1)
9 -#ldl := -ldl
10 -#LIBTYPE := -DSHAREDLIB
11 -#else
12 -#LIBTYPE := -DSTATICLIB
13 -#endif
14 +ifeq ($(SHARED),1)
15 +ldl := -ldl
16 +LIBTYPE := -DSHAREDLIB
17 +else
18 +LIBTYPE := -DSTATICLIB
19 +endif
21 # Preprocessor flags.
22 PKG_CPPFLAGS := -D_GNU_SOURCE -I proc
23 CPPFLAGS := -I/usr/include/ncurses
24 -ALL_CPPFLAGS := $(PKG_CPPFLAGS) $(CPPFLAGS)
25 +ALL_CPPFLAGS := $(PKG_CPPFLAGS) $(CPPFLAGS) $(LIBTYPE)
27 # Left out -Wconversion due to noise in glibc headers.
28 # Left out -Wunreachable-code and -Wdisabled-optimization
29 diff -aur procps-3.2.8.pristine//ps/output.c procps-3.2.8.new//ps/output.c
30 --- procps-3.2.8.pristine//ps/output.c 2010-07-23 15:45:52.836223643 +0200
31 +++ procps-3.2.8.new//ps/output.c 2010-07-23 15:54:41.372842564 +0200
32 @@ -1099,7 +1099,7 @@
33 return snprintf(outbuf, COLWID, "*");
37 +#ifdef STATICLIB
38 /****************** FLASK & seLinux security stuff **********************/
39 // move the bulk of this to libproc sometime
41 @@ -1131,7 +1131,7 @@
42 return 1;
45 -#if 0
46 +#else
47 // This needs more study, considering:
48 // 1. the static linking option (maybe disable this in that case)
49 // 2. the -z and -Z option issue
50 @@ -1143,7 +1143,7 @@
51 char *context;
53 if(!ps_getpidcon && !tried_load){
54 - void *handle = dlopen("libselinux.so.1", RTLD_NOW);
55 + void *handle = dlopen("libselinux.so", RTLD_NOW);
56 if(handle){
57 dlerror();
58 ps_getpidcon = dlsym(handle, "getpidcon");
59 diff -aur procps-3.2.8.pristine//w.c procps-3.2.8.new//w.c
60 --- procps-3.2.8.pristine//w.c 2010-07-23 15:45:52.829554761 +0200
61 +++ procps-3.2.8.new//w.c 2010-07-23 16:05:53.042775257 +0200
62 @@ -163,6 +163,10 @@
63 if(best && tmp->start_time <= best->start_time) continue;
64 best = tmp;
66 + /* It is there but SELinux wouldn't allow us to know the detail. Really
67 + w should just be given rights */
68 + if(!kill(u->ut_pid, 0) || errno != ESRCH)
69 + *found_utpid = 1;
70 return best ? best : secondbest;