Blob Blame History Raw
From b69d2f8decf044d5ee4c97a580bc36bb1735b1c7 Mon Sep 17 00:00:00 2001
From: Jake Hunsaker <jhunsake@redhat.com>
Date: Fri, 21 Dec 2018 15:47:27 -0500
Subject: [PATCH] [sosnode] Fix quoting for non-root su commands

Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
 soscollector/sosnode.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/soscollector/sosnode.py b/soscollector/sosnode.py
index 7fdb524..cfdb1e0 100644
--- a/soscollector/sosnode.py
+++ b/soscollector/sosnode.py
@@ -154,7 +154,7 @@ class SosNode():
         here we prefix the command with the correct bits
         '''
         if self.config['become_root']:
-            return "su -c '%s'" % cmd
+            return "su -c %s" % quote(cmd)
         if self.config['need_sudo']:
             return "sudo -S %s" % cmd
         return cmd
-- 
2.14.5