From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:26:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 590C01065679; Mon, 1 Jun 2009 20:26:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5CC8FC20; Mon, 1 Jun 2009 20:26:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51KQpdX090581; Mon, 1 Jun 2009 20:26:51 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51KQp6x090577; Mon, 1 Jun 2009 20:26:51 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906012026.n51KQp6x090577@svn.freebsd.org> From: Robert Watson Date: Mon, 1 Jun 2009 20:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193255 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:26:52 -0000 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 */