Skip to contentSkip to conversation

layerindex: don't use shell=True when cloning

PATCH New Ross Burton 1 participant 2 messages Nov 23, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 layerindex: don't use shell=True when cloning

---
 bitbake/lib/bblayers/layerindex.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bblayers/layerindex.py +1 -1
index 9f02a9da2ef..b2ff2268ea6 100644
@@ -28,7 +28,7 @@ class LayerIndexPlugin(ActionPlugin):
         layerdir = os.path.join(repodir, subdir)
         if not os.path.exists(repodir):
             if fetch_layer:
-                result = subprocess.call('git clone %s %s' % (url, repodir), shell = True)
+                result = subprocess.call(['git', 'clone', url, repodir])
                 if result:
                     logger.error("Failed to download %s" % url)
                     return None, None, None
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 fetch: don't use shell=True when listing ar files

---
 bitbake/lib/bb/fetch2/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bb/fetch2/__init__.py +1 -1
index 572b71a9655..8d05f0c3d82 100644
@@ -1469,7 +1469,7 @@ class FetchMethod(object):
                 else:
                     cmd = 'rpm2cpio.sh %s | cpio -id' % (file)
             elif file.endswith('.deb') or file.endswith('.ipk'):
-                output = subprocess.check_output('ar -t %s' % file, preexec_fn=subprocess_setup, shell=True)
+                output = subprocess.check_output(['ar', '-t', file], preexec_fn=subprocess_setup)
                 datafile = None
                 if output:
                     for line in output.decode().splitlines():
Signature · 1 line
2.11.0