Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Nov 2025 20:38:54 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 258411] blacklistctl dump fails shortly after first use
Message-ID:  <bug-258411-227-dc7Vp6dVoF@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-258411-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258411

--- Comment #3 from Jose Luis Duran <jlduran@FreeBSD.org> ---
(In reply to Ed Maste from comment #2)
I'm not sure if I understood, but I'll open a report upstream and
cross-reference it with this Bugzilla PR.

Naively, I can think of something like:

--- a/contrib/blocklist/bin/blocklistd.c
+++ b/contrib/blocklist/bin/blocklistd.c
@@ -541,15 +541,17 @@ main(int argc, char *argv[])
        state = state_open(dbfile, flags, 0600);
        if (state == NULL)
                state = state_open(dbfile,  flags | O_CREAT, 0600);
+       else {
+               if (restore) {
+                       if (!flush)
+                               rules_flush();
+                       rules_restore();
+               }
+       }
+
        if (state == NULL)
                return EXIT_FAILURE;

-       if (restore) {
-               if (!flush)
-                       rules_flush();
-               rules_restore();
-       }
-
        if (!debug) {
                if (daemon(0, 0) == -1)
                        err(EXIT_FAILURE, "daemon failed");

Because the errno that is triggering it is EFTYPE.  So if we only try to
restore the rules if the file already exists, we can overcome this issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-258411-227-dc7Vp6dVoF>