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

NAS-130413 / 24.04.3 / Fix get inherited ACL when top-level ds has ACL (by anodos325) #14141

Merged
merged 1 commit into from
Aug 6, 2024
Merged
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
13 changes: 7 additions & 6 deletions src/middlewared/middlewared/plugins/filesystem_/acl_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def acltool(self, path, action, uid, gid, options):
if acltool.returncode != 0:
raise CallError(f"acltool [{action}] on path {path} failed with error: [{acltool.stderr.decode().strip()}]")

def _common_perm_path_validate(self, schema, data, verrors):
def _common_perm_path_validate(self, schema, data, verrors, pool_mp_ok=False):
loc = path_location(data['path'])
if loc is FSLocation.EXTERNAL:
verrors.add(f'{schema}.path', 'ACL operations on remote server paths are not possible')
Expand Down Expand Up @@ -69,10 +69,11 @@ def _common_perm_path_validate(self, schema, data, verrors):
)

elif len(Path(st['realpath']).resolve().parents) == 2:
verrors.add(
f'{schema}.path',
f'The specified path is a ZFS pool mountpoint "({path})" '
)
if not pool_mp_ok:
verrors.add(
f'{schema}.path',
f'The specified path is a ZFS pool mountpoint "({path})" '
)

elif self.middleware.call_sync('pool.dataset.path_in_locked_datasets', st['realpath']):
verrors.add(
Expand Down Expand Up @@ -859,7 +860,7 @@ def add_to_acl(self, job, data):
def get_inherited_acl(self, data):
init_path = data['path']
verrors = ValidationErrors()
self._common_perm_path_validate('filesystem.add_to_acl', data, verrors)
self._common_perm_path_validate('filesystem.get_inherited_acl', data, verrors, True)
verrors.check()

current_acl = self.getacl(data['path'], False)
Expand Down
Loading