summaryrefslogtreecommitdiff
path: root/usr.sbin/acme-client/main.c
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2017-03-23 12:58:29 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2017-03-23 12:58:29 +0000
commitde20ac70f750d3df1ecd4ee78e7629a31aca0b7d (patch)
treeda67f3bfd3aac3e2013a183916f7c9af5262b0e4 /usr.sbin/acme-client/main.c
parent39886a666c196552c67bed369fd1682b59957c20 (diff)
pull root check up, the parser will bomb out anyway
OK benno
Diffstat (limited to 'usr.sbin/acme-client/main.c')
-rw-r--r--usr.sbin/acme-client/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/acme-client/main.c b/usr.sbin/acme-client/main.c
index dde8e8b638e..f8dc22c8756 100644
--- a/usr.sbin/acme-client/main.c
+++ b/usr.sbin/acme-client/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.33 2017/01/24 13:32:55 jsing Exp $ */
+/* $Id: main.c,v 1.34 2017/03/23 12:58:28 florian Exp $ */
/*
* Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -85,6 +85,9 @@ main(int argc, char *argv[])
goto usage;
}
+ if (getuid() != 0)
+ errx(EXIT_FAILURE, "must be run as root");
+
/* parse config file */
if ((conf = parse_config(conffile, popts)) == NULL)
exit(EXIT_FAILURE);
@@ -100,9 +103,6 @@ main(int argc, char *argv[])
argc--;
argv++;
- if (getuid() != 0)
- errx(EXIT_FAILURE, "must be run as root");
-
if (domain->cert != NULL) {
if ((certdir = dirname(domain->cert)) != NULL) {
if ((certdir = strdup(certdir)) == NULL)