Always disable root-squash
Initially, root squashing was only disabled for rw shares, but it should also be disabled for ro shares. Closes bug: #1735832 Change-Id: I916e8c6a8fb553350a977795cb1c4ab4ef817b98
This commit is contained in:
parent
c4b59336c2
commit
8429b9e4d5
manila
releasenotes/notes
@ -245,9 +245,7 @@ class NFSHelper(NASHelperBase):
|
||||
':'.join((host, local_path))])
|
||||
self._sync_nfs_temp_and_perm_files(server)
|
||||
for access in access_rules:
|
||||
rules_options = '%s,no_subtree_check'
|
||||
if access['access_level'] == const.ACCESS_LEVEL_RW:
|
||||
rules_options = ','.join((rules_options, 'no_root_squash'))
|
||||
rules_options = '%s,no_subtree_check,no_root_squash'
|
||||
access_to = self._get_parsed_address_or_cidr(
|
||||
access['access_to'])
|
||||
self._ssh_exec(
|
||||
@ -297,10 +295,7 @@ class NFSHelper(NASHelperBase):
|
||||
'name': share_name
|
||||
})
|
||||
else:
|
||||
rules_options = '%s,no_subtree_check'
|
||||
if access['access_level'] == const.ACCESS_LEVEL_RW:
|
||||
rules_options = ','.join((rules_options,
|
||||
'no_root_squash'))
|
||||
rules_options = '%s,no_subtree_check,no_root_squash'
|
||||
self._ssh_exec(
|
||||
server,
|
||||
['sudo', 'exportfs', '-o',
|
||||
|
@ -134,10 +134,7 @@ class NFSHelperTestCase(test.TestCase):
|
||||
|
||||
@ddt.data(const.ACCESS_LEVEL_RW, const.ACCESS_LEVEL_RO)
|
||||
def test_update_access(self, access_level):
|
||||
expected_mount_options = '%s,no_subtree_check'
|
||||
if access_level == const.ACCESS_LEVEL_RW:
|
||||
expected_mount_options = ','.join((expected_mount_options,
|
||||
'no_root_squash'))
|
||||
expected_mount_options = '%s,no_subtree_check,no_root_squash'
|
||||
self.mock_object(self._helper, '_sync_nfs_temp_and_perm_files')
|
||||
local_path = os.path.join(CONF.share_mount_path, self.share_name)
|
||||
exec_result = ' '.join([local_path, '2.2.2.3'])
|
||||
@ -231,10 +228,7 @@ class NFSHelperTestCase(test.TestCase):
|
||||
|
||||
@ddt.data(const.ACCESS_LEVEL_RW, const.ACCESS_LEVEL_RO)
|
||||
def test_update_access_recovery_mode(self, access_level):
|
||||
expected_mount_options = '%s,no_subtree_check'
|
||||
if access_level == const.ACCESS_LEVEL_RW:
|
||||
expected_mount_options = ','.join((expected_mount_options,
|
||||
'no_root_squash'))
|
||||
expected_mount_options = '%s,no_subtree_check,no_root_squash'
|
||||
access_rules = [test_generic.get_fake_access_rule(
|
||||
'1.1.1.1', access_level), ]
|
||||
self.mock_object(self._helper, '_sync_nfs_temp_and_perm_files')
|
||||
|
4
releasenotes/notes/bug-1735832-43e9291ddd73286d.yaml
Normal file
4
releasenotes/notes/bug-1735832-43e9291ddd73286d.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
fixes:
|
||||
- Root uses can now correctly read files on read-only shares
|
||||
when the LVM or generic drivers are used.
|
Loading…
x
Reference in New Issue
Block a user