Date: Wed, 6 Jul 2005 15:34:53 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 79656 for review Message-ID: <200507061534.j66FYrma017896@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=79656 Change 79656 by rwatson@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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507061534.j66FYrma017896>