From af89d03118e2c14e2121b73961871af89f65d86d Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 25 Feb 2025 13:07:38 +0300 Subject: [PATCH] nfqws,tpws: fix hostlist-domains file open test --- nfq/nfqws.c | 4 ++-- tpws/tpws.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nfq/nfqws.c b/nfq/nfqws.c index d0430f2..9d2c0e9 100644 --- a/nfq/nfqws.c +++ b/nfq/nfqws.c @@ -126,14 +126,14 @@ static bool test_list_files() struct ipset_file *ifile; LIST_FOREACH(hfile, ¶ms.hostlists, next) - if (!file_open_test(hfile->filename, O_RDONLY)) + if (hfile->filename && !file_open_test(hfile->filename, O_RDONLY)) { DLOG_PERROR("file_open_test"); DLOG_ERR("cannot access hostlist file '%s'\n",hfile->filename); return false; } LIST_FOREACH(ifile, ¶ms.ipsets, next) - if (!file_open_test(ifile->filename, O_RDONLY)) + if (hfile->filename && !file_open_test(ifile->filename, O_RDONLY)) { DLOG_PERROR("file_open_test"); DLOG_ERR("cannot access ipset file '%s'\n",ifile->filename); diff --git a/tpws/tpws.c b/tpws/tpws.c index 24596c5..ea71787 100644 --- a/tpws/tpws.c +++ b/tpws/tpws.c @@ -122,14 +122,14 @@ static bool test_list_files() struct ipset_file *ifile; LIST_FOREACH(hfile, ¶ms.hostlists, next) - if (!file_open_test(hfile->filename, O_RDONLY)) + if (hfile->filename && !file_open_test(hfile->filename, O_RDONLY)) { DLOG_PERROR("file_open_test"); DLOG_ERR("cannot access hostlist file '%s'\n",hfile->filename); return false; } LIST_FOREACH(ifile, ¶ms.ipsets, next) - if (!file_open_test(ifile->filename, O_RDONLY)) + if (hfile->filename && !file_open_test(ifile->filename, O_RDONLY)) { DLOG_PERROR("file_open_test"); DLOG_ERR("cannot access ipset file '%s'\n",ifile->filename);