Previously, any present override for a given network or ASN would have
caused the SQL statement not to conduct anything at all. Since "is_drop"
is the only flag being actually set here, it makes sense to do so in
case of already present overrides as well.
The effect of this is limited: Our own override files are always
considered at last, so in case of conflicts they will be the ultima
ratio. This is an intended behaviour, but slipped my mind when I filed
bug #12728, so this patch can only be seen as a partial solution - the
rest is not a bug, but a feature. :-)
Partially fixes: #12728
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
source,
is_drop
) VALUES (%s, %s, %s)
- ON CONFLICT (network) DO NOTHING""",
+ ON CONFLICT (network) DO UPDATE SET is_drop = True""",
"%s" % network,
"Spamhaus DROP lists",
True
source,
is_drop
) VALUES (%s, %s, %s)
- ON CONFLICT (number) DO NOTHING""",
+ ON CONFLICT (number) DO UPDATE SET is_drop = True""",
"%s" % asn,
"Spamhaus ASN-DROP list",
True