[Bug 258411] blacklistctl dump fails shortly after first use
- In reply to: bugzilla-noreply_a_freebsd.org: "[Bug 258411] blacklistctl dump fails shortly after first use"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 17 Nov 2025 16:41:44 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258411
--- Comment #2 from Ed Maste <emaste@freebsd.org> ---
IMO we should either not create but not populate the file, or just treat an
empty file as identical to a missing file. E.g. in state_open():
DB *
state_open(const char *dbname, int flags, mode_t perm)
{
DB *db;
...
db = dbopen(dbname, flags, perm, DB_HASH, &openinfo);
if (db == NULL) {
if (errno == ENOENT && (flags & O_CREAT) == 0)
return NULL;
(*lfun)(LOG_ERR, "%s: can't open `%s' (%m)", __func__, dbname);
}
return db;
}
We could add a check for an empty file and also return NULL.
--
You are receiving this mail because:
You are the assignee for the bug.