[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:
patchback[bot] 2025-08-10 13:51:23 +02:00 committed by GitHub
commit f2d1099b83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View 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).

View file

@ -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