diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-11-21 14:31:43 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-30 15:48:10 +0000 |
commit | 38438b6cf42fb7ad45b9a901f57913af7e7591a3 (patch) | |
tree | 1ea9bd4fa7b7b90fb4a0d4a65235e18062ff2872 /bitbake/lib/bb/fetch2/__init__.py | |
parent | 4e48892b859b3fe04c8c12b22d8975eed21c086b (diff) | |
download | poky-38438b6cf42fb7ad45b9a901f57913af7e7591a3.tar.gz |
bitbake: fetch2: obey BB_ALLOWED_NETWORKS when checking network access
[YOCTO #10508]
(Bitbake rev: ddd3bc2d64d7240ecb6b6e4a1ae29b1faef6cc22)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 2bb41a4a94..d6d7850dfb 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -856,12 +856,15 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None, workdir=None): | |||
856 | 856 | ||
857 | return output | 857 | return output |
858 | 858 | ||
859 | def check_network_access(d, info = "", url = None): | 859 | def check_network_access(d, info, url): |
860 | """ | 860 | """ |
861 | log remote network access, and error if BB_NO_NETWORK is set | 861 | log remote network access, and error if BB_NO_NETWORK is set or the given |
862 | URI is untrusted | ||
862 | """ | 863 | """ |
863 | if d.getVar("BB_NO_NETWORK") == "1": | 864 | if d.getVar("BB_NO_NETWORK") == "1": |
864 | raise NetworkAccess(url, info) | 865 | raise NetworkAccess(url, info) |
866 | elif not trusted_network(d, url): | ||
867 | raise UntrustedUrl(url, info) | ||
865 | else: | 868 | else: |
866 | logger.debug(1, "Fetcher accessed the network with the command %s" % info) | 869 | logger.debug(1, "Fetcher accessed the network with the command %s" % info) |
867 | 870 | ||