diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2007-02-24 17:35:09 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2007-02-24 17:35:09 +0000 |
commit | f9fbfbf829223da29f9bceee5878ac57f54d43ad (patch) | |
tree | 1622de5465d951facef5694065311223929ba1a7 | |
parent | 091779099cd4d0d6ac1e07486333c80a56cf4a34 (diff) |
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>
-rw-r--r-- | usr.sbin/authpf/authpf.c | 10 |
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); } |