[gnome-continuous-yocto/gnomeostree-3.28-rocko: 2938/8267] bitbake: main: Check bitbake server-only port is a number
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 2938/8267] bitbake: main: Check bitbake server-only port is a number
- Date: Sat, 16 Dec 2017 23:55:55 +0000 (UTC)
commit b9d6a7cc234f44e44e5421191924b7463e9c0a9d
Author: Benjamin Esquivel <benjamin esquivel linux intel com>
Date: Fri Oct 7 16:46:26 2016 -0500
bitbake: main: Check bitbake server-only port is a number
Either using the memres script or the bitbake call with --server-only
if the port is a string instead of a number then the process hangs
indefinitely causing a loop that never ends.
Add a check at the beginning for the port being a number otherwise
show an error message and exit cleanly.
[YOCTO #10397]
(Bitbake rev: 35927a98daeeb854ef5782e900206af6cd96b3d7)
Signed-off-by: Benjamin Esquivel <benjamin esquivel linux intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
bitbake/lib/bb/main.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py
index 7f7d87b..f2f59f6 100755
--- a/bitbake/lib/bb/main.py
+++ b/bitbake/lib/bb/main.py
@@ -402,6 +402,13 @@ def bitbake_main(configParams, configuration):
if not configParams.bind:
raise BBMainException("FATAL: The '--server-only' option requires a name/address "
"to bind to with the -B option.\n")
+ else:
+ try:
+ #Checking that the port is a number
+ int(configParams.bind.split(":")[1])
+ except (ValueError,IndexError):
+ raise BBMainException(
+ "FATAL: Malformed host:port bind parameter")
if configParams.remote_server:
raise BBMainException("FATAL: The '--server-only' option conflicts with %s.\n" %
("the BBSERVER environment variable" if "BBSERVER" in os.environ \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]