Skip to content

Commit 4adb7b1

Browse files
committed
comment on Firewall error handling
addresses https://github.com/bsdci/libioc/pull/646/files#r257515382
1 parent 06e0242 commit 4adb7b1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

libioc/Firewall.py

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def ensure_firewall_enabled(self) -> None:
7373
)
7474
return
7575
except Exception:
76+
# an IocageException is raised in the next step at the right level
7677
pass
7778

7879
hint = f"sysctl {key} is expected to be {expected}, but was {current}"

libioc/Jail.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,7 @@ def __get_launch_command(jail_args: typing.List[str]) -> typing.List[str]:
16611661
@property
16621662
def _launch_args(self) -> typing.List[str]:
16631663
config = self.config
1664+
vnet = (config["vnet"] is True)
16641665
value: str
16651666
jail_param_args: typing.List[str] = []
16661667
for sysctl_name, sysctl in libioc.JailParams.JailParams().items():
@@ -1677,11 +1678,13 @@ def _launch_args(self) -> typing.List[str]:
16771678
elif sysctl_name == "security.jail.param.allow.mount.zfs":
16781679
value = str(self._allow_mount_zfs)
16791680
elif sysctl_name == "security.jail.param.vnet":
1680-
if config["vnet"] is False:
1681+
if vnet is False:
16811682
# vnet is only used when explicitly enabled
16821683
# (friendly to Kernels without VIMAGE support)
16831684
continue
16841685
value = "vnet"
1686+
elif vnet and sysctl_name.startswith("security.jail.param.ip"):
1687+
continue
16851688
else:
16861689
config_property_name = sysctl.iocage_name
16871690
if self.config._is_known_property(config_property_name):

0 commit comments

Comments
 (0)