summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-11-13 15:28:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-16 11:55:07 +0000
commit9d8e36a6c9663a1665ecefca59d172ad53f90ffe (patch)
tree264b8cec39b31534c64634b9a5112a0a6f56b0a4 /bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
parent4677d8b4fb9ab00970ccc6c07d4e75a103dce3f5 (diff)
downloadpoky-9d8e36a6c9663a1665ecefca59d172ad53f90ffe.tar.gz
bitbake: toaster: localhostbectrl Pass DATABASE_URL in via the process environment
Instead of putting the DATABASE_URL as part of the command for launching the bitbake observer process set it as part of environment. This fixes two issues 1. Where the value isn't quoted and therefore will be interpreted in the shell and 2. Anyone being able to see the value of DATABASE_URL in the process tree. [YOCTO #8669] (Bitbake rev: 832a8523067606b180c02f0d1544e8a23219bb08) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/localhostbecontroller.py')
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index b5cf5591fd..854a6bbfe2 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -48,7 +48,6 @@ class LocalhostBEController(BuildEnvironmentController):
48 48
49 def __init__(self, be): 49 def __init__(self, be):
50 super(LocalhostBEController, self).__init__(be) 50 super(LocalhostBEController, self).__init__(be)
51 self.dburl = settings.getDATABASE_URL()
52 self.pokydirname = None 51 self.pokydirname = None
53 self.islayerset = False 52 self.islayerset = False
54 53
@@ -126,9 +125,17 @@ class LocalhostBEController(BuildEnvironmentController):
126 port = i.split(" ")[-1] 125 port = i.split(" ")[-1]
127 logger.debug("localhostbecontroller: Found bitbake server port %s" % port) 126 logger.debug("localhostbecontroller: Found bitbake server port %s" % port)
128 127
129 cmd = "bash -c \"source %s/oe-init-build-env-memres -1 %s && DATABASE_URL=%s %s --observe-only -u toasterui --remote-server=0.0.0.0:-1 -t xmlrpc\"" % (self.pokydirname, self.be.builddir, self.dburl, own_bitbake) 128 cmd = "bash -c \"source %s/oe-init-build-env-memres -1 %s && %s --observe-only -u toasterui --remote-server=0.0.0.0:-1 -t xmlrpc\"" % \
129 (self.pokydirname, self.be.builddir, own_bitbake)
130
131 # Use a copy of the current environment and add the DATABASE_URL
132 # for the bitbake observer process.
133 env = os.environ.copy()
134 env['DATABASE_URL'] = settings.getDATABASE_URL()
135
130 with open(toaster_ui_log_filepath, "a+") as f: 136 with open(toaster_ui_log_filepath, "a+") as f:
131 p = subprocess.Popen(cmd, cwd = self.be.builddir, shell=True, stdout=f, stderr=f) 137 p = subprocess.Popen(cmd, cwd = self.be.builddir, shell=True,
138 stdout=f, stderr=f, env=env)
132 139
133 def _toaster_ui_started(filepath, filepos = 0): 140 def _toaster_ui_started(filepath, filepos = 0):
134 if not os.path.exists(filepath): 141 if not os.path.exists(filepath):