mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
ipatests: fix ipahealthcheck fixture _modify_permission
The test is storing the initial file permissions obtained with 'stat', then modifies them, calls ipa-healthcheck and reverts the permissions to the original value. When the file is a symlink, stat returns the permissions of the link, not of the pointed-to file. But chmod modifies the permissions of the pointed-to file, not of the link. As a consequence, the fixture does not properly restore the original file permissions. The fix consists in calling 'stat -L' because the command follows links. Signed-off-by: Florence Blanc-Renaud <flo@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
82216bfa3d
commit
27ae8a93f5
@ -1583,7 +1583,7 @@ def modify_permissions():
|
||||
if 'host' not in state:
|
||||
state['host'] = host
|
||||
if path not in state:
|
||||
cmd = ["/usr/bin/stat", "-c", "%U:%G:%a", path]
|
||||
cmd = ["/usr/bin/stat", "-L", "-c", "%U:%G:%a", path]
|
||||
result = host.run_command(cmd)
|
||||
state[path] = result.stdout_text.strip()
|
||||
if owner is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user