diff options
author | Sebastien Marie <semarie@cvs.openbsd.org> | 2015-11-02 16:31:56 +0000 |
---|---|---|
committer | Sebastien Marie <semarie@cvs.openbsd.org> | 2015-11-02 16:31:56 +0000 |
commit | 93e7798dbebb58d8b449923cb2a715f86ae4d948 (patch) | |
tree | 20cbdfb1c661801835312c2a4ce1acd23e374f6e /sys/kern/tty_pty.c | |
parent | 4f5fa3d8a1576b11fc8b513a7e2f3d2d0275c3f1 (diff) |
move the pledgenote annotation from `struct proc' to `struct nameidata'
pledgenote is used for annotate the policy for a namei context. So make it
tracking the nameidata.
It is expected for the caller to explicitly define the policy. It is a kernel
bug to not do so.
ok deraadt@
Diffstat (limited to 'sys/kern/tty_pty.c')
-rw-r--r-- | sys/kern/tty_pty.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 81d5b5d5fc7..94b7a144321 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_pty.c,v 1.72 2015/10/28 11:22:08 deraadt Exp $ */ +/* $OpenBSD: tty_pty.c,v 1.73 2015/11/02 16:31:55 semarie Exp $ */ /* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */ /* @@ -1100,9 +1100,9 @@ retry: if ((error = check_pty(minor(newdev)))) goto bad; pti = pt_softc[minor(newdev)]; - p->p_pledgenote = PLEDGE_RPATH | PLEDGE_WPATH; NDINIT(&cnd, LOOKUP, NOFOLLOW|LOCKLEAF, UIO_SYSSPACE, pti->pty_pn, p); + cnd.ni_pledge = PLEDGE_RPATH | PLEDGE_WPATH; if ((error = ptm_vn_open(&cnd)) != 0) { /* * Check if the master open failed because we lost @@ -1127,9 +1127,9 @@ retry: * 2. Revoke all the users of the slave. * 3. open the slave. */ - p->p_pledgenote = PLEDGE_RPATH | PLEDGE_WPATH; NDINIT(&snd, LOOKUP, NOFOLLOW|LOCKLEAF, UIO_SYSSPACE, pti->pty_sn, p); + snd.ni_pledge = PLEDGE_RPATH | PLEDGE_WPATH; if ((error = namei(&snd)) != 0) goto bad; if ((snd.ni_vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { @@ -1161,9 +1161,9 @@ retry: */ vrele(snd.ni_vp); - p->p_pledgenote = PLEDGE_RPATH | PLEDGE_WPATH; NDINIT(&snd, LOOKUP, NOFOLLOW|LOCKLEAF, UIO_SYSSPACE, pti->pty_sn, p); + snd.ni_pledge = PLEDGE_RPATH | PLEDGE_WPATH; /* now open it */ if ((error = ptm_vn_open(&snd)) != 0) goto bad; |