PERFORCE change 163672 for review

Robert Watson rwatson at FreeBSD.org
Sat Jun 6 21:53:55 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=163672

Change 163672 by rwatson at rwatson_freebsd_capabilities on 2009/06/06 21:53:02

	Properly #ifdef CAPABILITIES various capability-related monitoring
	parts in kern_descript.c.

Affected files ...

.. //depot/projects/trustedbsd/capabilities/src/sys/kern/kern_descrip.c#22 edit

Differences ...

==== //depot/projects/trustedbsd/capabilities/src/sys/kern/kern_descrip.c#22 (text+ko) ====

@@ -37,6 +37,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: src/sys/kern/kern_descrip.c,v 1.353 2009/06/02 06:55:32 jeff Exp $");
 
+#include "opt_capabilities.h"
 #include "opt_compat.h"
 #include "opt_ddb.h"
 #include "opt_ktrace.h"
@@ -2794,6 +2795,7 @@
 		tp = NULL;
 		kif->kf_fd = i;
 
+#ifdef CAPABILITIES
 		/*
 		 * When reporting a capability, most fields will be from the
 		 * underlying object, but do mark as a capability.  With
@@ -2804,6 +2806,10 @@
 			kif->kf_flags |= KF_FLAG_CAPABILITY;
 			(void)cap_fextract(fp, 0, &fp);
 		}
+#else
+		KASSERT(fp->f_type != DTYPE_CAPABILITY,
+		    ("sysctl_kern_proc_filedesc: saw capability"));
+#endif
 		switch (fp->f_type) {
 		case DTYPE_VNODE:
 			kif->kf_type = KF_TYPE_VNODE;
@@ -3063,6 +3069,7 @@
 		tp = NULL;
 		kif->kf_fd = i;
 
+#ifdef CAPABILITIES
 		/*
 		 * When reporting a capability, most fields will be from the
 		 * underlying object, but do mark as a capability and export
@@ -3073,6 +3080,10 @@
 			kif->kf_cap_rights = cap_rights(fp);
 			(void)cap_fextract(fp, 0, &fp);
 		}
+#else
+		KASSERT(fp->f_type != DTYPE_CAPABILITY,
+		    ("sysctl_kern_proc_filedesc: saw capability"));
+#endif
 		switch (fp->f_type) {
 		case DTYPE_VNODE:
 			kif->kf_type = KF_TYPE_VNODE;


More information about the p4-projects mailing list