From 16ea52bff5757a846d855325cc94bee868b5c39a Mon Sep 17 00:00:00 2001 From: tedu Date: Fri, 25 Feb 2022 18:29:32 +0000 Subject: [PATCH] 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). --- usr.bin/doas/doas.c | 7 ++----- 1 file 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 * @@ -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) -- 2.20.1