opendoas

A portable version of the OpenBSD `doas` command
git clone https://pi.duncano.de/git/opendoas.git
Log | Files | Refs | README | LICENSE

commit 84b171f3d6944dd793c81e474724f5210764b81c
parent 8a932c141276ebd1d33216e3da558308c329580c
Author: Ted Unangst <tedu@openbsd.org>
Date:   Tue, 21 Jul 2015 16:15:20 +0000

oops, previous commit regarding cases should have just been for parse.y.

then a commit that says:
add a -C option to check config files without running. ok halex

then *this* commit:
use setresuid to be explicit. suggested by deraadt

Diffstat:
doas.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doas.c b/doas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: doas.c,v 1.15 2015/07/21 11:04:06 zhuk Exp $ */ +/* $OpenBSD: doas.c,v 1.16 2015/07/21 16:12:04 tedu Exp $ */ /* * Copyright (c) 2015 Ted Unangst <tedu@openbsd.org> * @@ -297,7 +297,8 @@ main(int argc, char **argv, char **envp) while ((ch = getopt(argc, argv, "C:su:")) != -1) { switch (ch) { case 'C': - setuid(getuid()); + target = getuid(); + setresuid(target, target, target); parseconfig(optarg); exit(0); case 'u':