summaryrefslogtreecommitdiff
path: root/usr.bin/doas
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2022-02-25 18:29:33 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2022-02-25 18:29:33 +0000
commit4fcef955cfee9a2056dd076fe9708a3602079592 (patch)
tree5c245834f14768ad6c7c70b8eaefda98ce0e1b91 /usr.bin/doas
parente05036de0651d18fedcd157bf0c43b4bdf5d2706 (diff)
use setall for setusercontext, to make it simpler to inherit new changes.
note that the addition of setenv doesn't do much, since doas will rewrite the environment anyway (but added variables are accessible in keepenv, should anybody be using that feature).
Diffstat (limited to 'usr.bin/doas')
-rw-r--r--usr.bin/doas/doas.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/usr.bin/doas/doas.c b/usr.bin/doas/doas.c
index 673ebd0927b..0e0cea18dd7 100644
--- a/usr.bin/doas/doas.c
+++ b/usr.bin/doas/doas.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: doas.c,v 1.94 2022/02/10 13:06:46 robert Exp $ */
+/* $OpenBSD: doas.c,v 1.95 2022/02/25 18:29:32 tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -452,10 +452,7 @@ main(int argc, char **argv)
if (targpw == NULL)
errx(1, "no passwd entry for target");
- if (setusercontext(NULL, targpw, target, LOGIN_SETGROUP |
- LOGIN_SETPATH |
- LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETUMASK |
- LOGIN_SETUSER) != 0)
+ if (setusercontext(NULL, targpw, target, LOGIN_SETALL) == -1)
errx(1, "failed to set user context for target");
if (pledge("stdio rpath exec", NULL) == -1)