mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-11 16:44:22 -07:00
xfs_quota: command args as list rather than string (#10609)
This commit is contained in:
parent
5d3662b23c
commit
9fc5d2ec4d
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):
|
def exec_quota(module, xfs_quota_bin, cmd, mountpoint):
|
||||||
cmd = [xfs_quota_bin, "-x", "-c"] + [cmd, mountpoint]
|
cmd = [xfs_quota_bin, "-x", "-c", cmd, mountpoint]
|
||||||
(rc, stdout, stderr) = module.run_command(cmd, use_unsafe_shell=True)
|
(rc, stdout, stderr) = module.run_command(cmd)
|
||||||
if (
|
if (
|
||||||
"XFS_GETQUOTA: Operation not permitted" in stderr.split("\n")
|
"XFS_GETQUOTA: Operation not permitted" in stderr.split("\n")
|
||||||
or rc == 1
|
or rc == 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue