]> git.ipfire.org Git - dbl.git/commitdiff
dnsbl: Set the mtime of the file to when the list was last updated
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 6 Dec 2025 18:52:50 +0000 (18:52 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 6 Dec 2025 18:52:50 +0000 (18:52 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/dnsbl.in

index c628a59ca27bbe82fa4b32c50504bab233535f21..82ac600e54d10568bb1af10ef57937974a34bdda 100644 (file)
@@ -296,11 +296,16 @@ class CLI(object):
                                        except FileNotFoundError:
                                                pass
 
+                                       # Set the modification time (so that clients won't download again
+                                       # just because we have done a re-export)
+                                       os.utime(f.name, (list.updated_at.timestamp(), list.updated_at.timestamp()))
+
+                                       # Fix permissions
+                                       os.chmod(f.name, 0o644)
+
                                        # Once the output has been written in full, we will rename the file
                                        os.link(f.name, name)
 
-                                       # Fix permissions
-                                       os.chmod(name, 0o644)
 
        def __add_source(self, backend, args):
                """