mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-11 08:34:21 -07:00
[PR #10609/9fc5d2ec backport][stable-11] xfs_quota: command args as list rather than string (#10627)
xfs_quota: command args as list rather than string (#10609)
(cherry picked from commit 9fc5d2ec4d
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
438ed7ea0e
commit
f2d1099b83
2 changed files with 4 additions and 2 deletions
2
changelogs/fragments/10609-xfs-quota-cmd-list.yml
Normal file
2
changelogs/fragments/10609-xfs-quota-cmd-list.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- xfs_quota - using safer mechanism to run external command (https://github.com/ansible-collections/community.general/pull/10609).
|
|
@ -457,8 +457,8 @@ def quota_report(module, xfs_quota_bin, mountpoint, name, quota_type, used_type)
|
|||
|
||||
|
||||
def exec_quota(module, xfs_quota_bin, cmd, mountpoint):
|
||||
cmd = [xfs_quota_bin, "-x", "-c"] + [cmd, mountpoint]
|
||||
(rc, stdout, stderr) = module.run_command(cmd, use_unsafe_shell=True)
|
||||
cmd = [xfs_quota_bin, "-x", "-c", cmd, mountpoint]
|
||||
(rc, stdout, stderr) = module.run_command(cmd)
|
||||
if (
|
||||
"XFS_GETQUOTA: Operation not permitted" in stderr.split("\n")
|
||||
or rc == 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue