diff options
author | 2003-12-22 15:11:45 +0000 | |
---|---|---|
committer | 2003-12-22 15:11:45 +0000 | |
commit | 425e4d196e1f681ab65d826bf1e3d0c0be8d0798 (patch) | |
tree | ce7dc6490f4d65e08a74f2ad1e6dc6a548b5061d | |
parent | add a configtest mode (diff) | |
download | wireguard-openbsd-425e4d196e1f681ab65d826bf1e3d0c0be8d0798.tar.xz wireguard-openbsd-425e4d196e1f681ab65d826bf1e3d0c0be8d0798.zip |
uid check later; configtest is useful as non-root
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 2395d583389..ef65fbb75fb 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.16 2003/12/22 15:07:05 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.17 2003/12/22 15:11:45 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -103,9 +103,6 @@ main(int argc, char *argv[]) log_init(1); /* log to stderr until daemonized */ - if (geteuid()) - errx(1, "need root privileges"); - bzero(&conf, sizeof(conf)); bzero(&mrtconf, sizeof(mrtconf)); LIST_INIT(&mrtconf); @@ -139,13 +136,16 @@ main(int argc, char *argv[]) } if (parse_config(conffile, &conf, &mrtconf)) - exit (1); + exit(1); if (conf.opts & BGPD_OPT_NOACTION) { fprintf(stderr, "configuration OK\n"); exit(0); } + if (geteuid()) + errx(1, "need root privileges"); + signal(SIGTERM, sighdlr); signal(SIGINT, sighdlr); signal(SIGCHLD, sighdlr); |