From 8ccfdb874e8db922996d67237d11bdd38f354f9c Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Thu, 10 Dec 2015 00:00:19 +0100 Subject: [PATCH] Remove a unneeded use of use_unsafe_shell Since use_unsafe_shell is suspicious from a security point of view (or it wouldn't be unsafe), the less we have, the less code we have to toroughly inspect for a security audit. --- system/hostname.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/hostname.py b/system/hostname.py index 2d14b0893b7..1b577367c3e 100644 --- a/system/hostname.py +++ b/system/hostname.py @@ -260,8 +260,8 @@ class SystemdStrategy(GenericStrategy): (rc, out, err)) def get_permanent_hostname(self): - cmd = 'hostnamectl --static status' - rc, out, err = self.module.run_command(cmd, use_unsafe_shell=True) + cmd = ['hostnamectl', '--static', 'status'] + rc, out, err = self.module.run_command(cmd) if rc != 0: self.module.fail_json(msg="Command failed rc=%d, out=%s, err=%s" % (rc, out, err))