diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-23 21:32:30 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-23 21:32:30 +0000 |
commit | 263bf5316c4979e765a23737a314a8f4b5ddbe63 (patch) | |
tree | 2bd3dcb5816c04980b4254efac0b2dad17c038b1 | |
parent | 2fdf4bde975768e7d12a834837a2033078f2bb57 (diff) |
the "getpw" test for /dev/tty is only needed for readpassphrase(3),
getpass(3), so don't specifically allow it for "rpath" (rpath will
accept it in the end, unless it is on the whitelist)
-rw-r--r-- | sys/kern/kern_pledge.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 10c9b4c6879..b7b71b46e76 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.121 2015/11/23 07:23:24 deraadt Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.122 2015/11/23 21:32:29 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -645,8 +645,8 @@ pledge_namei(struct proc *p, struct nameidata *ni, char *origpath) return (0); } - /* readpassphrase(3), getpw*(3) */ - if ((p->p_p->ps_pledge & (PLEDGE_TTY | PLEDGE_GETPW)) && + /* readpassphrase(3), getpass(3) */ + if ((p->p_p->ps_pledge & PLEDGE_TTY) && (ni->ni_pledge & ~(PLEDGE_RPATH | PLEDGE_WPATH)) == 0 && strcmp(path, "/dev/tty") == 0) { return (0); |