Skip to content

Commit

Permalink
Raise ValidationError on perm change for readonly paths
Browse files Browse the repository at this point in the history
This commit introduces additional validation to check whether the
path on which user is trying to change permissions is set to
readonly. This appears to be a fairly common occurance with our
SCALE userbase and so we need to cleanly explain why they can't
do this.
  • Loading branch information
anodos325 committed Jan 21, 2025
1 parent 21b2b89 commit 0a1fc7e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/middlewared/middlewared/plugins/filesystem_/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ def _common_perm_path_validate(self, schema, data, verrors, pool_mp_ok=False):
f'{schema}.path',
'Path component for is currently encrypted and locked'
)
else:
statfs_flags = self.middleware.call_sync('filesystem.statfs', path)['flags']
if 'RO' in statfs_flags:
verrors.add(
f'{schema}.path',
f'{path}: dataset underlying path has the readonly property enabled.'
)

return loc

Expand Down

0 comments on commit 0a1fc7e

Please sign in to comment.