]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
main: Check bitbake server-only port is a number
authorBenjamin Esquivel <benjamin.esquivel@linux.intel.com>
Fri, 7 Oct 2016 21:46:26 +0000 (16:46 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 8 Oct 2016 06:46:16 +0000 (07:46 +0100)
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]

Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/main.py

index 7f7d87bd022ca6fbf14bc3d522d249ca21b5de26..f2f59f670afaaaad82a2438884b48f6478870992 100755 (executable)
@@ -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 \