From 9fc5d2ec4dab6e9f56ad186b720568ca2a3493d9 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Sun, 10 Aug 2025 23:34:30 +1200 Subject: [PATCH] xfs_quota: command args as list rather than string (#10609) --- changelogs/fragments/10609-xfs-quota-cmd-list.yml | 2 ++ plugins/modules/xfs_quota.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/10609-xfs-quota-cmd-list.yml diff --git a/changelogs/fragments/10609-xfs-quota-cmd-list.yml b/changelogs/fragments/10609-xfs-quota-cmd-list.yml new file mode 100644 index 0000000000..74e170ef09 --- /dev/null +++ b/changelogs/fragments/10609-xfs-quota-cmd-list.yml @@ -0,0 +1,2 @@ +minor_changes: + - xfs_quota - using safer mechanism to run external command (https://github.com/ansible-collections/community.general/pull/10609). diff --git a/plugins/modules/xfs_quota.py b/plugins/modules/xfs_quota.py index 3b0b2bd19e..bef8dd8f0b 100644 --- a/plugins/modules/xfs_quota.py +++ b/plugins/modules/xfs_quota.py @@ -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