PERFORCE change 79656 for review

Robert Watson rwatson at FreeBSD.org
Wed Jul 6 15:34:53 GMT 2005


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

Change 79656 by rwatson at rwatson_zoo on 2005/07/06 15:34:52

	Prototype code to accept a mount label from nmount().  #if'd 0.
	
	Also correct a syntax error.

Affected files ...

.. //depot/projects/trustedbsd/sebsd/sys/kern/vfs_mount.c#18 edit

Differences ...

==== //depot/projects/trustedbsd/sebsd/sys/kern/vfs_mount.c#18 (text+ko) ====

@@ -470,7 +470,14 @@
 	struct vfsoptlist *optlist;
 	char *fstype, *fspath;
 	int error, fstypelen, fspathlen;
+#if 0
+	char *labelstr;
+	int labelstrlen;
+#endif
+	struct label *label;
 
+	label = NULL;
+
 	error = vfs_buildopts(fsoptions, &optlist);
 	if (error)
 		return (error);
@@ -503,10 +510,36 @@
 		goto bail;
 	}
 
+#if 0
+	/*
+	 * XXXMAC: In __mac_execve(), we have entry and exit entry points so
+	 * that less of the label frobbing is visible in the calling code.
+	 * We might want to think about doing that here also.
+	 */
+	labelstrlen = 0;
+	error = vfs_getopt(optlist, "label", (void **)&labelstr,
+	    &labelstrlen);
+	if (error != ENOENT) {
+		if (error || labelstr[labelstrlen - 1] != '\0') {
+			error = EINVAL;
+			goto bail;
+		}
+
+		label = mac_mount_label_alloc();
+		error = mac_internalize_mount_label(label, labelstr);
+		if (error)
+			goto bail;
+	}
+#endif
+
 	mtx_lock(&Giant);
-	error = vfs_domount(td, fstype, fspath, fsflags, optlist, NULL);
+	error = vfs_domount(td, fstype, fspath, fsflags, optlist, label);
 	mtx_unlock(&Giant);
 bail:
+#if 0
+	if (label != NULL)
+		mac_mount_label_free(label);
+#endif
 	if (error)
 		vfs_freeopts(optlist);
 	return (error);
@@ -581,7 +614,7 @@
 	char *fspath,		/* Mount path. */
 	int fsflags,		/* Flags common to all filesystems. */
 	void *fsdata,		/* Options local to the filesystem. */
-	struct label *mntlabel, /* MAC label */
+	struct label *mntlabel	/* MAC label */
 	)
 {
 	struct vnode *vp;
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list