summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2020-12-06 19:51:03 +0000
committerkrw <krw@openbsd.org>2020-12-06 19:51:03 +0000
commit43894c334eb7ec94ae8e17159f64a5208d4d3206 (patch)
tree0517e3229e1452bfe7a304e2f34fa0acf1dafd0f
parentAdd support for RSASSA-PSS signature verification (RFC 7427). (diff)
downloadwireguard-openbsd-43894c334eb7ec94ae8e17159f64a5208d4d3206.tar.xz
wireguard-openbsd-43894c334eb7ec94ae8e17159f64a5208d4d3206.zip
Oops. Missed chunk in previous.
fatal() immediately whem parsing command line option '-c' reveals a non-existant file. Original diff, tweaks & ok kn@
-rw-r--r--sbin/dhclient/clparse.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c
index c8ddfa033ef..a430f4ee36f 100644
--- a/sbin/dhclient/clparse.c
+++ b/sbin/dhclient/clparse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clparse.c,v 1.199 2020/05/13 20:55:41 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.200 2020/12/06 19:51:03 krw Exp $ */
/* Parser for dhclient config and lease files. */
@@ -168,9 +168,11 @@ read_conf(char *name, char *ignore_list, struct ether_addr *hwaddr)
init_config();
- new_parse(path_dhclient_conf);
-
- if ((cfile = fopen(path_dhclient_conf, "r")) != NULL) {
+ if (path_dhclient_conf != NULL) {
+ cfile = fopen(path_dhclient_conf, "r");
+ if (cfile == NULL)
+ fatal("fopen(%s)", path_dhclient_conf);
+ new_parse(path_dhclient_conf);
for (;;) {
token = peek_token(NULL, cfile);
if (token == EOF)