diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-12-09 03:44:28 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-12-09 03:44:28 +0000 |
commit | c5caffe9c429caa50e5fbb079d7ee14257116c62 (patch) | |
tree | d6e9f6d24a2d8fb99e7d51ac22d960517e26182b /sys/fs/devfs | |
parent | 5fcceddc0789f268ea6002c625215947c0cbe4b9 (diff) | |
download | FreeBSD-src-c5caffe9c429caa50e5fbb079d7ee14257116c62.zip FreeBSD-src-c5caffe9c429caa50e5fbb079d7ee14257116c62.tar.gz |
Remove dm_root entry from struct devfs_mount. It's never set, and is
unused. Replace it with a dm_mount back-pointer to the struct mount
that the devfs_mount is associated with. Export that pointer to MAC
Framework entry points, where all current policies don't use the
pointer. This permits the SEBSD port of SELinux's FLASK/TE to compile
out-of-the-box on 5.0-CURRENT with full file system labeling support.
Approved by: re (murray)
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/fs/devfs')
-rw-r--r-- | sys/fs/devfs/devfs.h | 2 | ||||
-rw-r--r-- | sys/fs/devfs/devfs_devs.c | 6 | ||||
-rw-r--r-- | sys/fs/devfs/devfs_vfsops.c | 3 | ||||
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/sys/fs/devfs/devfs.h b/sys/fs/devfs/devfs.h index a30bbde..7c660ec 100644 --- a/sys/fs/devfs/devfs.h +++ b/sys/fs/devfs/devfs.h @@ -168,7 +168,7 @@ struct devfs_dirent { }; struct devfs_mount { - struct vnode *dm_root; /* Root node */ + struct mount *dm_mount; struct devfs_dirent *dm_rootdir; struct devfs_dirent *dm_basedir; unsigned dm_generation; diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c index c01eba4..cb7c99c 100644 --- a/sys/fs/devfs/devfs_devs.c +++ b/sys/fs/devfs/devfs_devs.c @@ -334,8 +334,8 @@ devfs_populate(struct devfs_mount *dm) if (de == NULL) { de = devfs_vmkdir(s, q - s, dd); #ifdef MAC - mac_create_devfs_directory(s, q - s, - de); + mac_create_devfs_directory( + dm->dm_mount, s, q - s, de); #endif de->de_inode = dm->dm_inode++; TAILQ_INSERT_TAIL(&dd->de_dlist, de, de_list); @@ -363,7 +363,7 @@ devfs_populate(struct devfs_mount *dm) de->de_dirent->d_type = DT_CHR; } #ifdef MAC - mac_create_devfs_device(dev, de); + mac_create_devfs_device(dm->dm_mount, dev, de); #endif *dep = de; de->de_dir = dd; diff --git a/sys/fs/devfs/devfs_vfsops.c b/sys/fs/devfs/devfs_vfsops.c index 5f4d855..e74b4e9 100644 --- a/sys/fs/devfs/devfs_vfsops.c +++ b/sys/fs/devfs/devfs_vfsops.c @@ -88,6 +88,7 @@ devfs_nmount(mp, ndp, td) #ifdef MAC mp->mnt_flag |= MNT_MULTILABEL; #endif + fmp->dm_mount = mp; mp->mnt_data = (qaddr_t) fmp; vfs_getnewfsid(mp); @@ -96,7 +97,7 @@ devfs_nmount(mp, ndp, td) fmp->dm_rootdir = devfs_vmkdir("(root)", 6, NULL); fmp->dm_rootdir->de_inode = 2; #ifdef MAC - mac_create_devfs_directory("", 0, fmp->dm_rootdir); + mac_create_devfs_directory(mp, "", 0, fmp->dm_rootdir); #endif fmp->dm_basedir = fmp->dm_rootdir; devfs_rules_newmount(fmp, td); diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index f7b99d5..844d6bc 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -832,7 +832,7 @@ devfs_setlabel(ap) de = vp->v_data; mac_relabel_vnode(ap->a_cred, vp, ap->a_label); - mac_update_devfsdirent(de, vp); + mac_update_devfsdirent(vp->v_mount, de, vp); return (0); } @@ -869,7 +869,7 @@ devfs_symlink(ap) bcopy(ap->a_target, de->de_symlink, i); lockmgr(&dmp->dm_lock, LK_EXCLUSIVE, 0, curthread); #ifdef MAC - mac_create_devfs_symlink(ap->a_cnp->cn_cred, dd, de); + mac_create_devfs_symlink(ap->a_cnp->cn_cred, dmp->dm_mount, dd, de); #endif TAILQ_INSERT_TAIL(&dd->de_dlist, de, de_list); devfs_allocv(de, ap->a_dvp->v_mount, ap->a_vpp, 0); |