|
@ -1,4 +1,4 @@ |
|
|
/* $OpenBSD: ntpd.c,v 1.50 2007/08/22 21:04:30 ckuethe Exp $ */ |
|
|
|
|
|
|
|
|
/* $OpenBSD: ntpd.c,v 1.51 2007/09/13 14:34:36 pyr Exp $ */ |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> |
|
|
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> |
|
@ -96,7 +96,7 @@ main(int argc, char *argv[]) |
|
|
log_init(1); /* log to stderr until daemonized */ |
|
|
log_init(1); /* log to stderr until daemonized */ |
|
|
res_init(); /* XXX */ |
|
|
res_init(); /* XXX */ |
|
|
|
|
|
|
|
|
while ((ch = getopt(argc, argv, "df:sSv")) != -1) { |
|
|
|
|
|
|
|
|
while ((ch = getopt(argc, argv, "df:nsSv")) != -1) { |
|
|
switch (ch) { |
|
|
switch (ch) { |
|
|
case 'd': |
|
|
case 'd': |
|
|
lconf.debug = 1; |
|
|
lconf.debug = 1; |
|
@ -104,6 +104,9 @@ main(int argc, char *argv[]) |
|
|
case 'f': |
|
|
case 'f': |
|
|
conffile = optarg; |
|
|
conffile = optarg; |
|
|
break; |
|
|
break; |
|
|
|
|
|
case 'n': |
|
|
|
|
|
lconf.noaction = 1; |
|
|
|
|
|
break; |
|
|
case 's': |
|
|
case 's': |
|
|
lconf.settime = 1; |
|
|
lconf.settime = 1; |
|
|
break; |
|
|
break; |
|
@ -122,6 +125,11 @@ main(int argc, char *argv[]) |
|
|
if (parse_config(conffile, &lconf)) |
|
|
if (parse_config(conffile, &lconf)) |
|
|
exit(1); |
|
|
exit(1); |
|
|
|
|
|
|
|
|
|
|
|
if (lconf.noaction) { |
|
|
|
|
|
fprintf(stderr, "configuration OK\n"); |
|
|
|
|
|
exit(0); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (geteuid()) { |
|
|
if (geteuid()) { |
|
|
fprintf(stderr, "ntpd: need root privileges\n"); |
|
|
fprintf(stderr, "ntpd: need root privileges\n"); |
|
|
exit(1); |
|
|
exit(1); |
|
|