Module Name:    src
Committed By:   pooka
Date:           Mon Aug 30 10:49:40 UTC 2010

Modified Files:
        src/sys/rump/librump/rumpkern: rump.c

Log Message:
* record proc's cred in p_cred too
* account procs for uids


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/rump/librump/rumpkern/rump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.182 src/sys/rump/librump/rumpkern/rump.c:1.183
--- src/sys/rump/librump/rumpkern/rump.c:1.182	Thu Aug 26 19:56:07 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Mon Aug 30 10:49:40 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.182 2010/08/26 19:56:07 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.183 2010/08/30 10:49:40 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.182 2010/08/26 19:56:07 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.183 2010/08/30 10:49:40 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -530,8 +530,9 @@
 		p->p_fd = fd_init(NULL);
 		p->p_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
 		p->p_pgrp = &rump_pgrp;
-		l->l_cred = rump_cred_suserget();
+		p->p_cred = l->l_cred = rump_cred_suserget();
 
+		chgproccnt(0, 1);
 		atomic_inc_uint(&nprocs);
 	} else {
 		p = &proc0;
@@ -576,6 +577,7 @@
 	if (p->p_pid != 0) {
 		mutex_obj_free(p->p_lock);
 		fd_free();
+		chgproccnt(kauth_cred_getuid(p->p_cred), -1);
 		if (rump_proc_vfs_release)
 			rump_proc_vfs_release(p);
 		rump_cred_put(l->l_cred);

Reply via email to