Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Mar 2011 18:12:04 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r220212 - head/sys/kern
Message-ID:  <201103311812.p2VIC4V5014443@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Thu Mar 31 18:12:04 2011
New Revision: 220212
URL: http://svn.freebsd.org/changeset/base/220212

Log:
  Notify racct when process credentials change.
  
  Sponsored by:	The FreeBSD Foundation
  Reviewed by:	kib (earlier version)

Modified:
  head/sys/kern/kern_prot.c

Modified: head/sys/kern/kern_prot.c
==============================================================================
--- head/sys/kern/kern_prot.c	Thu Mar 31 16:30:14 2011	(r220211)
+++ head/sys/kern/kern_prot.c	Thu Mar 31 18:12:04 2011	(r220212)
@@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/sysproto.h>
 #include <sys/jail.h>
 #include <sys/pioctl.h>
+#include <sys/racct.h>
 #include <sys/resourcevar.h>
 #include <sys/socket.h>
 #include <sys/socketvar.h>
@@ -584,6 +585,9 @@ setuid(struct thread *td, struct setuid_
 	}
 	p->p_ucred = newcred;
 	PROC_UNLOCK(p);
+#ifdef RACCT
+	racct_proc_ucred_changed(p, oldcred, newcred);
+#endif
 	uifree(uip);
 	crfree(oldcred);
 	return (0);
@@ -922,6 +926,9 @@ setreuid(register struct thread *td, str
 	}
 	p->p_ucred = newcred;
 	PROC_UNLOCK(p);
+#ifdef RACCT
+	racct_proc_ucred_changed(p, oldcred, newcred);
+#endif
 	uifree(ruip);
 	uifree(euip);
 	crfree(oldcred);
@@ -1060,6 +1067,9 @@ setresuid(register struct thread *td, st
 	}
 	p->p_ucred = newcred;
 	PROC_UNLOCK(p);
+#ifdef RACCT
+	racct_proc_ucred_changed(p, oldcred, newcred);
+#endif
 	uifree(ruip);
 	uifree(euip);
 	crfree(oldcred);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103311812.p2VIC4V5014443>