diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-01-13 22:20:36 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-01-13 22:20:36 +0000 |
| commit | 9c71cb4befad5ef84b09742331c31a14887724ae (patch) | |
| tree | 951fa9709e9d03b4e78204be6055e8e1d8fdb8a2 /sys/fs | |
| parent | 6dcbe61c90c26532c8e0fb73a99c470ba4e286ef (diff) | |
Notes
Diffstat (limited to 'sys/fs')
| -rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 3f285667387d..6f466ad88428 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -181,13 +181,24 @@ devfs_access(ap) { struct vnode *vp = ap->a_vp; struct devfs_dirent *de; + int error; de = vp->v_data; if (vp->v_type == VDIR) de = de->de_dir; - return (vaccess(vp->v_type, de->de_mode, de->de_uid, de->de_gid, - ap->a_mode, ap->a_cred, NULL)); + error = vaccess(vp->v_type, de->de_mode, de->de_uid, de->de_gid, + ap->a_mode, ap->a_cred, NULL); + if (!error) + return (error); + if (error != EACCES) + return (error); + /* We do, however, allow access to the controlling terminal */ + if (!(ap->a_td->td_proc->p_flag & P_CONTROLT)) + return (error); + if (ap->a_td->td_proc->p_session->s_ttyvp == de->de_vnode) + return (0); + return (error); } static int |
