PERFORCE change 134988 for review

Robert Watson rwatson at FreeBSD.org
Thu Feb 7 06:37:31 PST 2008


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

Change 134988 by rwatson at rwatson_freebsd_capabilities on 2008/02/07 14:36:44

	Comment on .fo_flags, and why it's OK to hard-code DFLAG_PASSABLE,
	and not to specific DFLAG_SEEKABLE.

Affected files ...

.. //depot/projects/trustedbsd/capabilities/src/sys/kern/sys_capability.c#16 edit

Differences ...

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

@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$P4: //depot/projects/trustedbsd/capabilities/src/sys/kern/sys_capability.c#15 $");
+__FBSDID("$P4: //depot/projects/trustedbsd/capabilities/src/sys/kern/sys_capability.c#16 $");
 
 #include <sys/param.h>
 #include <sys/capability.h>
@@ -95,7 +95,18 @@
 	.fo_kqfilter = capability_kqfilter,
 	.fo_stat = capability_stat,
 	.fo_close = capability_close,
-	.fo_flags = DFLAG_PASSABLE,		/* XXXRW: DFLAG_SEEKABLE? */
+
+	/*
+	 * Possibly we should have two fileops vectors, one with and one
+	 * without DFLAG_PASSABLE, in order to support wrapping objects who
+	 * don't have DFLAG_PASSABLE.  On the other hand, there are no such
+	 * objects, which raises the question as to why the flag exists at
+	 * all.
+	 *
+	 * No need to set DFLAG_SEEKABLE as any seek operations will fall
+	 * through to the underlying object once the capability is verified.
+	 */
+	.fo_flags = DFLAG_PASSABLE,
 };
 
 static uma_zone_t capability_zone;


More information about the p4-projects mailing list