diff options
author | 2015-10-28 11:18:58 +0000 | |
---|---|---|
committer | 2015-10-28 11:18:58 +0000 | |
commit | 3bcad2c4a2fac43bd9255466e4b45c7ca00bd31d (patch) | |
tree | d0db04b1b220a8c2a95882abe15831e4846ae82d | |
parent | TIOCCONS will probably never be permitted, but it is good style to set (diff) | |
download | wireguard-openbsd-3bcad2c4a2fac43bd9255466e4b45c7ca00bd31d.tar.xz wireguard-openbsd-3bcad2c4a2fac43bd9255466e4b45c7ca00bd31d.zip |
Set pledgenote to PLEDGE_RPATH in chdir & chroot
noticed by semarie
-rw-r--r-- | sys/kern/vfs_syscalls.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index e9c22cd45e7..02a60c90e91 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.233 2015/10/25 20:39:54 deraadt Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.234 2015/10/28 11:18:58 deraadt Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -732,6 +732,7 @@ sys_chdir(struct proc *p, void *v, register_t *retval) int error; struct nameidata nd; + p->p_pledgenote = PLEDGE_RPATH; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, SCARG(uap, path), p); if ((error = change_dir(&nd, p)) != 0) @@ -759,6 +760,7 @@ sys_chroot(struct proc *p, void *v, register_t *retval) if ((error = suser(p, 0)) != 0) return (error); + p->p_pledgenote = PLEDGE_RPATH; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, SCARG(uap, path), p); if ((error = change_dir(&nd, p)) != 0) |