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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to