summaryrefslogtreecommitdiffstats
path: root/usr.sbin/authpf
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2007-02-24 17:35:08 +0000
committerbeck <beck@openbsd.org>2007-02-24 17:35:08 +0000
commitbd736532b328ec86348d1e4ad25097693bb8a86d (patch)
treeb091005dac24b4c5c33117cb0dc2da1d33356ab3 /usr.sbin/authpf
parentlicense + copyright (diff)
downloadwireguard-openbsd-bd736532b328ec86348d1e4ad25097693bb8a86d.tar.xz
wireguard-openbsd-bd736532b328ec86348d1e4ad25097693bb8a86d.zip
exit right away if the config file isn't there, rather than
doing a whole bunch of needless screwing around noticed by Stefan Krah <stefan-usenet@bytereef.org>
Diffstat (limited to 'usr.sbin/authpf')
-rw-r--r--usr.sbin/authpf/authpf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/authpf/authpf.c b/usr.sbin/authpf/authpf.c
index 2ef99ceb770..68adcd258ee 100644
--- a/usr.sbin/authpf/authpf.c
+++ b/usr.sbin/authpf/authpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authpf.c,v 1.103 2007/02/24 17:21:04 beck Exp $ */
+/* $OpenBSD: authpf.c,v 1.104 2007/02/24 17:35:08 beck Exp $ */
/*
* Copyright (C) 1998 - 2007 Bob Beck (beck@openbsd.org).
@@ -86,6 +86,10 @@ main(int argc, char *argv[])
login_cap_t *lc;
config = fopen(PATH_CONFFILE, "r");
+ if (config == NULL) {
+ syslog(LOG_ERR, "can not open %s (%m)", PATH_CONFFILE);
+ exit(1);
+ }
if ((cp = getenv("SSH_TTY")) == NULL) {
syslog(LOG_ERR, "non-interactive session connection for authpf");
@@ -268,8 +272,8 @@ main(int argc, char *argv[])
do_death(0);
}
- if (config == NULL || read_config(config)) {
- syslog(LOG_INFO, "bad or nonexistent %s", PATH_CONFFILE);
+ if (read_config(config)) {
+ syslog(LOG_ERR, "invalid config file %s", PATH_CONFFILE);
do_death(0);
}