Skip to content

Commit e341b42

Browse files
CP-40754 The firewall-port script returns true if port 80 is blocked and false if it is closed, this is captured in set_https_only to update the DB based on the tate of the network not the requested setting should there be a failure
Signed-off-by: jameshensmancitrix <james.hensman@citrix.com>
1 parent 0ac90b0 commit e341b42

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

ocaml/xapi/xapi_host.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,6 +2928,7 @@ let apply_updates ~__context ~self ~hash =
29282928

29292929
let set_https_only ~__context ~self ~value =
29302930
let state = match value with true -> "close" | false -> "open" in
2931-
ignore
2932-
@@ Helpers.call_script !Xapi_globs.firewall_port_config_script [state; "80"] ;
2933-
Db.Host.set_https_only ~__context ~self ~value
2931+
let network_state =
2932+
Helpers.call_script !Xapi_globs.firewall_port_config_script [state; "80"]
2933+
in
2934+
Db.Host.set_https_only ~__context ~self ~value:(bool_of_string network_state)

scripts/plugins/firewall-port

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,13 @@ case "${OP}" in
5252
exit 1
5353
;;
5454
esac
55+
56+
if [[ -z `iptables -S $CHAIN | grep " $PORT "` ]]
57+
then
58+
echo true
59+
else
60+
echo false
61+
fi
62+
5563
exit 0
5664

0 commit comments

Comments
 (0)