aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@openbsd.org>2015-07-21 16:15:20 +0000
committerTed Unangst <tedu@openbsd.org>2015-07-21 16:15:20 +0000
commit84b171f3d6944dd793c81e474724f5210764b81c (patch)
tree184e8e2a75a696c976187c6c2751b5e92be501b7
parent8a932c141276ebd1d33216e3da558308c329580c (diff)
downloadopendoas-84b171f3d6944dd793c81e474724f5210764b81c.tar.gz
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
-rw-r--r--doas.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/doas.c b/doas.c
index aa21365..8899d78 100644
--- 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':