Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Feb 2008 14:37:30 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 134988 for review
Message-ID:  <200802071437.m17EbUhs076818@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=134988

Change 134988 by rwatson@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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802071437.m17EbUhs076818>