diff options
author | 2015-10-28 13:42:57 +0000 | |
---|---|---|
committer | 2015-10-28 13:42:57 +0000 | |
commit | 0c1a9995b10541807708c5be7845d5cc856ae5a7 (patch) | |
tree | e6f32cd3ea5671a7943da8e4988b73ad9140188c | |
parent | in pledge_namei(), move PLEDGE_EXEC check sooner: it doesn't depend of path (diff) | |
download | wireguard-openbsd-0c1a9995b10541807708c5be7845d5cc856ae5a7.tar.xz wireguard-openbsd-0c1a9995b10541807708c5be7845d5cc856ae5a7.zip |
canonpath() error isn't related to p_pledgenote requirement (only possible
error currently is ENAMETOOLONG), so don't use p_pledgenote when failing.
-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 add2926b8cb..113fdbbf54e 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.85 2015/10/28 13:36:38 semarie Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.86 2015/10/28 13:42:57 semarie Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -548,7 +548,7 @@ pledge_namei(struct proc *p, char *origpath) error = canonpath(origpath, path, sizeof(path)); if (error) - return (pledge_fail(p, error, p->p_pledgenote)); + return (pledge_fail(p, error, 0)); /* chmod(2), chflags(2), ... */ if ((p->p_pledgenote & PLEDGE_FATTR) && @@ -732,7 +732,7 @@ pledge_namei(struct proc *p, char *origpath) free(builtpath, M_TEMP, builtlen); if (error != 0) { free(canopath, M_TEMP, MAXPATHLEN); - return (pledge_fail(p, error, p->p_pledgenote)); + return (pledge_fail(p, error, 0)); } //printf("namei: canopath = %s strlen %lld\n", canopath, |