mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-05 22:43:24 +00:00
18 lines
333 B
Plaintext
18 lines
333 B
Plaintext
Ruby-acl provides Access Control List checks.
|
|
|
|
list = %w(
|
|
deny all
|
|
allow 192.168.1.*
|
|
allow 127.0.0.1
|
|
)
|
|
acl = ACL.new(list, ACL::DENY_ALLOW)
|
|
...
|
|
ns = soc.accept
|
|
unless acl.allow_socket?(ns)
|
|
# forbidden
|
|
end
|
|
|
|
|
|
Author: Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
|
|
WWW: http://www.ruby-lang.org/en/raa-list.rhtml?name=acl
|