Commit 93b8e4b1 authored by Steve Kemp's avatar Steve Kemp
Browse files

Added comment about expiry period. Updated to use "|" for consistency

 in comments.
parent 88b805f2
......@@ -43,7 +43,7 @@
# Each addition is one of the two forms:
#
# 1.2.3.4.auto The IPv4 address 1.2.3.4
# 2001:123:456:789::-64.auto The IPv6 range 2001:123:456:789::/64
# 2001:123:456:789::|64.auto The IPv6 range 2001:123:456:789::/64
#
# It should be noted that IPv6 addresses will be added as entire /64s.
#
......@@ -53,7 +53,7 @@
# Once that directory has been written, symbiosis-firewall(1) is called with
# the reload-blacklist action.
#
# Most of the flags above are passed straigh on to symbiosis-firewall(1).
# Most of the flags above are passed straight on to symbiosis-firewall(1).
#
# SEE ALSO
#
......@@ -176,7 +176,10 @@ unless File.directory?( blacklist_d )
FileUtils.mkdir_p blacklist_d
end
expire_before = Time.now - ( expire_after * 24 * 60 * 60 )
#
# Expiry is defined in terms of days.
#
expire_before = Time.now - ( expire_after * ( 24 * 60 * 60 ) )
#
# Expire old entries first of all, then add new ones.
......@@ -293,6 +296,8 @@ blacklist.generate.each do |ip, ports|
end
#
# Re-generate the blacklist chain
#
if ( updated || expired > 0 || force )
......
......@@ -168,7 +168,10 @@ unless File.directory?(whitelist_d)
FileUtils.mkdir_p(whitelist_d)
end
expire_before = Time.now - ( expire_after * 24 * 60 * 60 )
#
# Expiry is measured in days.
#
expire_before = Time.now - ( expire_after * ( 24 * 60 * 60 ) )
#
# Expire old entries first of all, then add new ones.
......@@ -224,7 +227,7 @@ Symbiosis::Utmp.read(wtmp_file).each do |entry|
# Mask IPv4 to /32s.
#
ip = ip.mask(32) if ip.ipv4?
#
# Only include globally routable IPs.
#
......@@ -250,7 +253,7 @@ Symbiosis::Utmp.read(wtmp_file).each do |entry|
fn += ".auto"
if ! File.exists?(fn)
updated=true
updated=true
puts "\tAdding to whitelist" if ( $VERBOSE )
#
......@@ -270,6 +273,8 @@ Symbiosis::Utmp.read(wtmp_file).each do |entry|
end
#
# Re-generate the whitelist chain
#
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment