Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2009 17:15:47 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 156096 for review
Message-ID:  <200901131715.n0DHFloj058981@repoman.freebsd.org>

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

Change 156096 by rwatson@rwatson_freebsd_capabilities on 2009/01/13 17:15:39

	OpenSolaris compat code now hides fget_{read,write}() behind
	getf(), so update it to capability support.

Affected files ...

.. //depot/projects/trustedbsd/capabilities/src/sys/cddl/compat/opensolaris/sys/file.h#2 edit
.. //depot/projects/trustedbsd/capabilities/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c#4 edit

Differences ...

==== //depot/projects/trustedbsd/capabilities/src/sys/cddl/compat/opensolaris/sys/file.h#2 (text+ko) ====

@@ -39,9 +39,11 @@
 {
 	struct file *fp;
 
-	if (write && fget_write(curthread, fd, &fp) == 0)
+	if (write && fget_write(curthread, fd, CAP_WRITE | CAP_SEEK, &fp) ==
+	    0)
 		return (fp);
-	else if (!write && fget_read(curthread, fd, &fp) == 0)
+	else if (!write && fget_read(curthread, CAP_READ | CAP_SEEK,  fd,
+	    &fp) == 0)
 		return (fp);
 	return (NULL);
 }

==== //depot/projects/trustedbsd/capabilities/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c#4 (text+ko) ====

@@ -2466,10 +2466,6 @@
 	    &props)) != 0)
 		return (error);
 
-#if 0
-	/* XXXRW: Is this the right capability? */
-	error = fget_read(td, zc->zc_cookie, CAP_READ | CAP_SEEK, &fp);
-#endif
 	fd = zc->zc_cookie;
 	fp = getf(fd, 0);
 	if (fp == NULL) {
@@ -2619,12 +2615,6 @@
 
 	fp = getf(zc->zc_cookie, 1);
 	if (fp == NULL) {
-#if 0
-	fd = zc->zc_cookie;
-	/* XXXRW: Is this the right capability? */
-	error = fget_write(td, fd, CAP_WRITE | CAP_SEEK, &fp);
-	if (error) {
-#endif
 		dmu_objset_close(tosnap);
 		if (fromsnap)
 			dmu_objset_close(fromsnap);



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