nfqws,tpws: r/o open instead of stat() for list file check

This commit is contained in:
bol-van
2025-02-04 23:28:18 +03:00
parent bd67b41f32
commit 5f9fa28251
6 changed files with 34 additions and 8 deletions

View File

@@ -126,16 +126,16 @@ static bool test_list_files()
struct ipset_file *ifile;
LIST_FOREACH(hfile, &params.hostlists, next)
if (!file_mod_time(hfile->filename))
if (!file_open_test(hfile->filename, O_RDONLY))
{
DLOG_PERROR("file_mod_time");
DLOG_PERROR("file_open_test");
DLOG_ERR("cannot access hostlist file '%s'\n",hfile->filename);
return false;
}
LIST_FOREACH(ifile, &params.ipsets, next)
if (!file_mod_time(ifile->filename))
if (!file_open_test(ifile->filename, O_RDONLY))
{
DLOG_PERROR("file_mod_time");
DLOG_PERROR("file_open_test");
DLOG_ERR("cannot access ipset file '%s'\n",ifile->filename);
return false;
}