Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow_nfsd new param #6

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion iocage_lib/ioc_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def __init__(self, location, checking_datasets, silent, callback):
@staticmethod
def get_version():
"""Sets the iocage configuration version."""
version = '30'
version = '31'

return version

Expand Down Expand Up @@ -916,6 +916,10 @@ def check_config(self, conf, default=False):
if not conf.get('allow_mount_linprocfs'):
conf['allow_mount_linprocfs'] = 0

# Version 31 key
if not conf.get('allow_nfsd'):
conf['allow_nfsd'] = 0

if not default:
conf.update(jail_conf)

Expand Down Expand Up @@ -1183,6 +1187,7 @@ def retrieve_default_props():
'allow_socket_af': 0,
'allow_tun': 0,
'allow_vmm': 0,
'allow_nfsd': 0,
'cpuset': 'off',
'rlimits': 'off',
'memoryuse': 'off',
Expand Down Expand Up @@ -1354,6 +1359,7 @@ class IOCJson(IOCConfiguration):
'allow_raw_sockets',
'allow_sysvipc',
'allow_set_hostname',
'allow_nfsd',
'mount_fdescfs',
'mount_devfs',
'ip6_saddrsel',
Expand Down Expand Up @@ -2105,6 +2111,7 @@ def json_check_prop(self, key, value, conf, default=False):
"allow_quotas": truth_variations,
"allow_socket_af": truth_variations,
"allow_vmm": truth_variations,
"allow_nfsd": truth_variations,
"vnet_interfaces": ("string", ),
# RCTL limits
"cpuset": ('string',),
Expand Down
9 changes: 8 additions & 1 deletion iocage_lib/ioc_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def __start_jail__(self):
allow_sysvipc = self.conf["allow_sysvipc"]
allow_raw_sockets = self.conf["allow_raw_sockets"]
allow_chflags = self.conf["allow_chflags"]
allow_nfsd = self.conf["allow_nfsd"]
allow_mlock = self.conf["allow_mlock"]
allow_mount = self.conf["allow_mount"]
allow_mount_devfs = self.conf["allow_mount_devfs"]
Expand Down Expand Up @@ -367,6 +368,12 @@ def __start_jail__(self):
_allow_vmm = f"allow.vmm={allow_vmm}"
_exec_created = f'exec.created={exec_created}'

# FreeBSD < 13.3 does not support nfsd in jail
if userland_version < 13.3:
_allow_nfsd = ''
else:
_allow_nfsd = f"allow.nfsd={allow_nfsd}"

if nat:
self.log.debug(f'Checking NAT backend: {nat_backend}')
self.__check_nat__(backend=nat_backend)
Expand Down Expand Up @@ -545,7 +552,7 @@ def __start_jail__(self):

parameters = [
fdescfs, _allow_mlock, tmpfs,
_allow_mount_fdescfs, _allow_mount_fusefs, _allow_vmm,
_allow_mount_fdescfs, _allow_mount_fusefs, _allow_vmm, _allow_nfsd,
f"allow.set_hostname={allow_set_hostname}",
f"mount.devfs={mount_devfs}",
f"allow.raw_sockets={allow_raw_sockets}",
Expand Down
Loading