svn commit: r193255 - in head/sys: kern sys

Robert Watson rwatson at FreeBSD.org
Mon Jun 1 20:26:52 UTC 2009


Author: rwatson
Date: Mon Jun  1 20:26:51 2009
New Revision: 193255
URL: http://svn.freebsd.org/changeset/base/193255

Log:
  Add a flags field to struct ucred, and export that via kinfo_proc,
  consuming one of its spare fields.  The cr_flags field is currently
  unused, but will be used for features, including capability mode and
  pay-as-you-go audit.
  
  Discussed with:	jhb, sson

Modified:
  head/sys/kern/kern_proc.c
  head/sys/sys/ucred.h
  head/sys/sys/user.h

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Mon Jun  1 20:21:13 2009	(r193254)
+++ head/sys/kern/kern_proc.c	Mon Jun  1 20:26:51 2009	(r193255)
@@ -736,6 +736,7 @@ fill_kinfo_proc_only(struct proc *p, str
 		    kp->ki_ngroups * sizeof(gid_t));
 		kp->ki_rgid = cred->cr_rgid;
 		kp->ki_svgid = cred->cr_svgid;
+		kp->ki_cr_flags = cred->cr_flags;
 		/* If jailed(cred), emulate the old P_JAILED flag. */
 		if (jailed(cred)) {
 			kp->ki_flag |= P_JAILED;

Modified: head/sys/sys/ucred.h
==============================================================================
--- head/sys/sys/ucred.h	Mon Jun  1 20:21:13 2009	(r193254)
+++ head/sys/sys/ucred.h	Mon Jun  1 20:26:51 2009	(r193255)
@@ -56,6 +56,7 @@ struct ucred {
 	struct uidinfo	*cr_ruidinfo;	/* per ruid resource consumption */
 	struct prison	*cr_prison;	/* jail(2) */
 	struct vimage	*cr_vimage;	/* vimage */
+	u_int		cr_flags;	/* credential flags */
 	void 		*cr_pspare[2];	/* general use 2 */
 #define	cr_endcopy	cr_label
 	struct label	*cr_label;	/* MAC label */

Modified: head/sys/sys/user.h
==============================================================================
--- head/sys/sys/user.h	Mon Jun  1 20:21:13 2009	(r193254)
+++ head/sys/sys/user.h	Mon Jun  1 20:26:51 2009	(r193255)
@@ -83,7 +83,7 @@
  * it in two places: function fill_kinfo_proc in sys/kern/kern_proc.c and
  * function kvm_proclist in lib/libkvm/kvm_proc.c .
  */
-#define	KI_NSPARE_INT	10
+#define	KI_NSPARE_INT	9
 #define	KI_NSPARE_LONG	12
 #define	KI_NSPARE_PTR	7
 
@@ -190,6 +190,7 @@ struct kinfo_proc {
 	 */
 	char	ki_sparestrings[68];	/* spare string space */
 	int	ki_spareints[KI_NSPARE_INT];	/* spare room for growth */
+	u_int	ki_cr_flags;		/* Credential flags */
 	int	ki_jid;			/* Process jail ID */
 	int	ki_numthreads;		/* XXXKSE number of threads in total */
 	lwpid_t	ki_tid;			/* XXXKSE thread id */


More information about the svn-src-head mailing list