diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-22 15:11:46 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-22 15:11:46 +0000 |
commit | d2f8ab4ead6fe5b17cf257e66cfef141f0989799 (patch) | |
tree | 6e4612f713e4afd23e91caf23f5b2dadcf859538 /usr.sbin/bgpd | |
parent | 77748065dd8ef1ede805b0af5727ccaba0bcd22a (diff) |
uid check later; configtest is useful as non-root
Diffstat (limited to 'usr.sbin/bgpd')
-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); |