summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm_file2.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-03-30 21:54:48 +0000
committerguenther <guenther@openbsd.org>2014-03-30 21:54:48 +0000
commitd559b8cb6cdd6f912edd28712213aec79fb0b7bc (patch)
treeffe701d81fb3c6b370ebfd396ab32a273424b5b5 /lib/libkvm/kvm_file2.c
parentSupport relative arguments to .ll (increase or decrease line length). (diff)
downloadwireguard-openbsd-d559b8cb6cdd6f912edd28712213aec79fb0b7bc.tar.xz
wireguard-openbsd-d559b8cb6cdd6f912edd28712213aec79fb0b7bc.zip
Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred Based on a discussion at c2k10 or so before noting that FreeBSD and NetBSD did this too. ok matthew@
Diffstat (limited to 'lib/libkvm/kvm_file2.c')
-rw-r--r--lib/libkvm/kvm_file2.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/libkvm/kvm_file2.c b/lib/libkvm/kvm_file2.c
index e0538f559c7..d1e5f72d328 100644
--- a/lib/libkvm/kvm_file2.c
+++ b/lib/libkvm/kvm_file2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_file2.c,v 1.34 2014/02/05 03:49:00 guenther Exp $ */
+/* $OpenBSD: kvm_file2.c,v 1.35 2014/03/30 21:54:49 guenther Exp $ */
/*
* Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -271,7 +271,6 @@ kvm_deadfile_byid(kvm_t *kd, int op, int arg, size_t esize, int *cnt)
struct processlist allprocess;
struct proc proc;
struct process *pr, process;
- struct pcred pcred;
struct ucred ucred;
char *filebuf = NULL;
int i, nfiles;
@@ -335,20 +334,14 @@ kvm_deadfile_byid(kvm_t *kd, int op, int arg, size_t esize, int *cnt)
continue;
}
- if (KREAD(kd, (u_long)process.ps_cred, &pcred)) {
- _kvm_err(kd, kd->program, "can't read pcred at %lx",
- (u_long)process.ps_cred);
- goto cleanup;
- }
- if (KREAD(kd, (u_long)pcred.pc_ucred, &ucred)) {
+ if (KREAD(kd, (u_long)process.ps_ucred, &ucred)) {
_kvm_err(kd, kd->program, "can't read ucred at %lx",
- (u_long)pcred.pc_ucred);
+ (u_long)process.ps_ucred);
goto cleanup;
}
process.ps_mainproc = &proc;
proc.p_p = &process;
- process.ps_cred = &pcred;
- pcred.pc_ucred = &ucred;
+ process.ps_ucred = &ucred;
if (op == KERN_FILE_BYUID && arg >= 0 &&
proc.p_ucred->cr_uid != (uid_t)arg) {