From: deraadt Date: Wed, 28 Oct 2015 11:18:58 +0000 (+0000) Subject: Set pledgenote to PLEDGE_RPATH in chdir & chroot X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3bcad2c4a2fac43bd9255466e4b45c7ca00bd31d;p=openbsd Set pledgenote to PLEDGE_RPATH in chdir & chroot noticed by semarie --- 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)