Skip to content

Commit 4f404a5

Browse files
authored
Raise ValidationError on perm change for readonly paths (#15452)
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.
1 parent 912a663 commit 4f404a5

File tree

1 file changed

+7
-0
lines changed
  • src/middlewared/middlewared/plugins/filesystem_

1 file changed

+7
-0
lines changed

src/middlewared/middlewared/plugins/filesystem_/acl.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ def _common_perm_path_validate(self, schema, data, verrors, pool_mp_ok=False):
8484
f'{schema}.path',
8585
'Path component for is currently encrypted and locked'
8686
)
87+
else:
88+
statfs_flags = self.middleware.call_sync('filesystem.statfs', path)['flags']
89+
if 'RO' in statfs_flags:
90+
verrors.add(
91+
f'{schema}.path',
92+
f'{path}: dataset underlying path has the readonly property enabled.'
93+
)
8794

8895
return loc
8996

0 commit comments

Comments
 (0)