diff options
author | 1999-03-18 08:34:18 +0000 | |
---|---|---|
committer | 1999-03-18 08:34:18 +0000 | |
commit | 14b453f4b9c02dd07f94f4150f3b73132c8e325e (patch) | |
tree | 75a5042abe5e34989c3b1399f1913f35bf706fe6 | |
parent | make sure mountpoint starts with '/' and call get_mp() from editor_name() instead of rolling our own (diff) | |
download | wireguard-openbsd-14b453f4b9c02dd07f94f4150f3b73132c8e325e.tar.xz wireguard-openbsd-14b453f4b9c02dd07f94f4150f3b73132c8e325e.zip |
Don't allow users to mount umapfs.
(only a problem when kern.usermount == 1)
-rw-r--r-- | sys/miscfs/umapfs/umap_vfsops.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/miscfs/umapfs/umap_vfsops.c b/sys/miscfs/umapfs/umap_vfsops.c index 584e27e0e3c..992fd5a4d35 100644 --- a/sys/miscfs/umapfs/umap_vfsops.c +++ b/sys/miscfs/umapfs/umap_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umap_vfsops.c,v 1.12 1998/02/08 22:41:41 tholo Exp $ */ +/* $OpenBSD: umap_vfsops.c,v 1.13 1999/03/18 08:34:18 art Exp $ */ /* $NetBSD: umap_vfsops.c,v 1.9 1996/02/09 22:41:05 christos Exp $ */ /* @@ -94,6 +94,12 @@ umapfs_mount(mp, path, data, ndp, p) #endif /* + * Don't allow users to play with umapfs (when usermount is true). + */ + if (p->p_ucred->cr_uid != 0) + return EPERM; + + /* * Update is a no-op */ if (mp->mnt_flag & MNT_UPDATE) { |