summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2014-02-20 15:55:51 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-02 11:56:15 +0100
commit604d82bc0e2e5061b8fb1dbadb55c95687471465 (patch)
tree565514b33fcc5381f1b4d0731f5c646ffe06a683 /bitbake
parent6aefc8058579459fb8fd26b3bf71efdad82a6a2d (diff)
downloadpoky-604d82bc0e2e5061b8fb1dbadb55c95687471465.tar.gz
bitbake: fetch2/__init__: Disable pseudo in runfetchcmd()
If a fetcher, e.g., git, is run when pseudo is active it will think it is running as root. If it in turn uses ssh (as git does), ssh too will think it is running as root. This will cause it to try to read root's ssh configuration from /root/.ssh which will fail. If ssh then needs to ask for credentials it will hang indefinitely as there is nowhere for it to ask the user for them (and even if there was it would not access the correct private keys). The solution to the above is to temporarily disable pseudo while executing any fetcher commands. There should be no reason for them to be executed under pseudo anyway so this should not be a problem. RP Ammendum: We finally did get more information about how to reproduce this problem, something needs to trigger bb.fetch2.get_srcrev() in a pseudo context, for example when AUTOREV is in use or the recipe doesn't have a defined SRCREV. That SRC_URI needs to be using protocol=ssh. This would trigger an ls-remote of the remote repo and if that happens under pseudo, the wrong ssh credentials may be attempted which can hang. [YOCTO #12464] (Bitbake rev: 5d42dce5e612060f4181c14e1cfdec2388bb7adf) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index b853da30bd..8b8be8fa8e 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -838,6 +838,9 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None, workdir=None):
838 if val: 838 if val:
839 cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd) 839 cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)
840 840
841 # Disable pseudo as it may affect ssh, potentially causing it to hang.
842 cmd = 'export PSEUDO_DISABLED=1; ' + cmd
843
841 logger.debug(1, "Running %s", cmd) 844 logger.debug(1, "Running %s", cmd)
842 845
843 success = False 846 success = False