1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-22 08:58:47 +00:00

Fix a SIGSEGV in ps/ps.c when ps is setuid root or when run by root.

kvm_t kv was not set to zero and therefore kvm_open(3) was not called.

Fix another SIGSEGV in ps caused by the -O compile flag) when the -ef
flags are passed to ps.

Approved by:	gahr (maintainer)
This commit is contained in:
Cy Schubert 2009-03-06 23:18:41 +00:00
parent d892537673
commit 21df3ce841
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=229594
3 changed files with 38 additions and 5 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= heirloom
PORTVERSION= 070715
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= sysutils
MASTER_SITES= SF

View File

@ -1,5 +1,5 @@
--- build/mk.config.orig Tue Feb 27 00:03:01 2007
+++ build/mk.config Wed Mar 28 10:53:59 2007
--- build/mk.config.orig 2007-07-15 06:36:59.000000000 -0700
+++ build/mk.config 2009-03-06 15:08:14.925988069 -0800
@@ -25,33 +25,33 @@
# Location for binaries that have no special personality. This location
# may be identical to that of one of the first three personalities below.
@ -118,3 +118,12 @@
#
# Compiler and linker flags. HOSTCC is for cross compiling.
@@ -195,7 +195,7 @@
# compiler mode (which is the default) until this issue is properly
# handled by the system vendor.
#
-CFLAGS = -O -fomit-frame-pointer $(WARN)
+CFLAGS = -fomit-frame-pointer $(WARN)
CFLAGS2 = -O2 -fomit-frame-pointer $(WARN)
CFLAGSS = -Os -fomit-frame-pointer $(WARN)
CFLAGSU = -O2 -fomit-frame-pointer -funroll-loops $(WARN)

View File

@ -1,5 +1,5 @@
--- ps/ps.c.orig 2007-10-05 15:41:41.000000000 +0200
+++ ps/ps.c 2007-10-05 15:43:31.000000000 +0200
--- ps/ps.c.orig 2007-02-02 06:40:20.000000000 -0800
+++ ps/ps.c 2009-03-06 14:51:53.455864840 -0800
@@ -88,6 +88,9 @@
#define proc process
#undef p_pgid
@ -10,3 +10,27 @@
#if defined (__DragonFly__)
#endif /* __DragonFly__ */
#elif defined (__hpux)
@@ -492,6 +495,7 @@
static void postproc(struct proc *);
static enum okay selectproc(struct proc *);
+static kvm_t *kv;
/************************************************************************
* Utility functions *
@@ -2140,7 +2144,6 @@
static enum okay
getproc_kvm(struct proc *p)
{
- static kvm_t *kv;
struct kinfo_proc *kp;
int c;
@@ -4875,6 +4878,7 @@
#ifdef __GLIBC__
putenv("POSIXLY_CORRECT=1");
#endif
+ kv = NULL;
progname = basename(argv[0]);
sysname(argc, argv);
defaults();