Index: system-config-printer-1.0.8/system-config-printer.py
===================================================================
--- system-config-printer-1.0.8.orig/system-config-printer.py
+++ system-config-printer-1.0.8/system-config-printer.py
@@ -3709,11 +3709,13 @@ class NewPrinterGUI(GtkGUI):
         return result.copy ()
 
     def get_hpfax_device_id(self, faxuri):
-        os.environ["URI"] = faxuri
-        cmd = 'LC_ALL=C DISPLAY= hp-info -d "${URI}"'
-        debugprint (faxuri + ": " + cmd)
+        new_environ = os.environ.copy()
+        new_environ['LC_ALL'] = "C"
+        new_environ['DISPLAY'] = ""
+        args = ["hp-info", "-x", "-i", "-d" + faxuri]
+        debugprint (faxuri + ": " + str(args))
         try:
-            p = subprocess.Popen (cmd, shell=True,
+            p = subprocess.Popen (args, env=new_environ,
                                   stdin=file("/dev/null"),
                                   stdout=subprocess.PIPE,
                                   stderr=subprocess.PIPE)
@@ -3739,15 +3741,14 @@ class NewPrinterGUI(GtkGUI):
             return cupshelpers.parseDeviceID ('MFG:HP;MDL:Fax;DES:HP Fax;')
 
     def get_hplip_uri_for_network_printer(self, host, mode):
-        os.environ["HOST"] = host
         if mode == "print": mod = "-c"
         elif mode == "fax": mod = "-f"
         else: mod = "-c"
-        cmd = 'hp-makeuri ' + mod + ' "${HOST}"'
-        debugprint (host + ": " + cmd)
+        args = ["hp-makeuri", mod, host]
+        debugprint (host + ": " + str(args))
         uri = None
         try:
-            p = subprocess.Popen (cmd, shell=True,
+            p = subprocess.Popen (args,
                                   stdin=file("/dev/null"),
                                   stdout=subprocess.PIPE,
                                   stderr=subprocess.PIPE)
@@ -3772,12 +3773,11 @@ class NewPrinterGUI(GtkGUI):
             host = device.uri[s:s+e]
         # Try to get make and model via SNMP
         if host:
-            os.environ["HOST"] = host
-            cmd = '/usr/lib/cups/backend/snmp "${HOST}"'
-            debugprint (host + ": " + cmd)
+            args = ["/usr/lib/cups/backend/snmp", host]
+            debugprint (host + ": " + str(args))
             stdout = None
             try:
-                p = subprocess.Popen (cmd, shell=True,
+                p = subprocess.Popen (args,
                                       stdin=file("/dev/null"),
                                       stdout=subprocess.PIPE,
                                       stderr=subprocess.PIPE)
Index: system-config-printer-1.0.8/troubleshoot/CheckPrinterSanity.py
===================================================================
--- system-config-printer-1.0.8.orig/troubleshoot/CheckPrinterSanity.py
+++ system-config-printer-1.0.8/troubleshoot/CheckPrinterSanity.py
@@ -71,14 +71,14 @@ class CheckPrinterSanity(Question):
             elif scheme == "smb":
                 u = smburi.SMBURI (uri)
                 (group, host, share, user, password) = u.separate ()
-                os.environ['HOST'] = host
+                new_environ = os.environ.copy()
+                new_environ['LC_ALL'] = "C"
                 if group:
-                    os.environ['GROUP'] = group
-                    cmdline = 'LC_ALL=C nmblookup -W "$GROUP" "$HOST"'
+                    args = ["nmblookup", "-W", group, host]
                 else:
-                    cmdline = 'LC_ALL=C nmblookup "$HOST"'
+                    args = ["nmblookup", host]
                 try:
-                    p = subprocess.Popen (cmdline, shell=True,
+                    p = subprocess.Popen (args, env=new_environ,
                                           stdin=file("/dev/null"),
                                           stdout=subprocess.PIPE,
                                           stderr=subprocess.PIPE)
@@ -95,10 +95,12 @@ class CheckPrinterSanity(Question):
                     # Problem executing command.
                     pass
             elif scheme == "hp":
-                os.environ['URI'] = uri
+                new_environ = os.environ.copy()
+                new_environ['LC_ALL'] = "C"
+                new_environ['DISPLAY'] = ""
                 try:
-                    p = subprocess.Popen ('LC_ALL=C DISPLAY= hp-info -d "$URI"',
-                                          shell=True,
+                    p = subprocess.Popen (args=["hp-info", "-d" + uri],
+                                          env=new_environ,
                                           stdin=file("/dev/null"),
                                           stdout=subprocess.PIPE,
                                           stderr=subprocess.PIPE)
Index: system-config-printer-1.0.8/troubleshoot/CheckUSBPermissions.py
===================================================================
--- system-config-printer-1.0.8.orig/troubleshoot/CheckUSBPermissions.py
+++ system-config-printer-1.0.8/troubleshoot/CheckUSBPermissions.py
@@ -55,9 +55,13 @@ class CheckUSBPermissions(Question):
         if not os.access (GETFACL, os.X_OK):
             return False
 
+        new_environ = os.environ.copy()
+        new_environ['LC_ALL'] = "C"
+
         # Run lsusb
         try:
-            lsusb = subprocess.Popen ("LC_ALL=C " + LSUSB + " -v", shell=True,
+            lsusb = subprocess.Popen (args=[LSUSB, "-v"],
+                                      env=new_environ,
                                       stdin=file("/dev/null"),
                                       stdout=subprocess.PIPE,
                                       stderr=subprocess.PIPE)
@@ -134,8 +138,8 @@ class CheckUSBPermissions(Question):
         perms = []
         for path in paths:
             try:
-                getfacl = subprocess.Popen ("LC_ALL=C %s %s" % (GETFACL, path),
-                                            shell=True,
+                getfacl = subprocess.Popen (args=[GETFACL, path],
+                                            env=new_environ,
                                             stdin=file("/dev/null"),
                                             stdout=subprocess.PIPE,
                                             stderr=subprocess.PIPE)
