]> git.armaanb.net Git - opendoas.git/commitdiff
oops, previous commit regarding cases should have just been for parse.y.
authorTed Unangst <tedu@openbsd.org>
Tue, 21 Jul 2015 16:15:20 +0000 (16:15 +0000)
committerTed Unangst <tedu@openbsd.org>
Tue, 21 Jul 2015 16:15:20 +0000 (16:15 +0000)
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

doas.c

diff --git a/doas.c b/doas.c
index aa2136502969eba879946e9576be5544181a62fe..8899d788af3089507aa86968d38a6a0780b4855e 100644 (file)
--- 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':