Module Name: src
Committed By: christos
Date: Tue Jun 2 14:02:39 UTC 2015
Modified Files:
src/external/bsd/blacklist/libexec: blacklistd-helper
Log Message:
make proto and port optional
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/blacklist/libexec/blacklistd-helper
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/blacklist/libexec/blacklistd-helper
diff -u src/external/bsd/blacklist/libexec/blacklistd-helper:1.4 src/external/bsd/blacklist/libexec/blacklistd-helper:1.5
--- src/external/bsd/blacklist/libexec/blacklistd-helper:1.4 Wed Jan 28 20:05:25 2015
+++ src/external/bsd/blacklist/libexec/blacklistd-helper Tue Jun 2 10:02:39 2015
@@ -11,7 +11,13 @@
case "$1" in
add)
- exec /sbin/npfctl rule $2 add block in final proto $3 from $4/$5 to any port $6
+ if [ -n "$3" ]; then
+ proto="proto $3"
+ fi
+ if [ -n "$6" ]; then
+ port="port $6"
+ fi
+ exec /sbin/npfctl rule $2 add block in final $proto from $4/$5 to any $port
;;
rem)
exec /sbin/npfctl rule $2 rem-id $7