Bug 1350887 - Bind sacrificial goat to ephemeral port; r=whimboo
☠☠ backed out by c68909a45262 ☠ ☠
authorAndreas Tolfsen <ato@mozilla.com>
Tue, 28 Mar 2017 16:46:54 +0100
changeset 399118 f54dbd3d2e62deabbbe805bc1edfcf30f33f135b
parent 399117 f41bca9ebd0b827d859b5b88818949e1c67fefcf
child 399119 4bdb7f1403703b49f3438078bbe249e8e86e6bdc
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1350887
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1350887 - Bind sacrificial goat to ephemeral port; r=whimboo Port 666 is in the protected port range and can not normally be bound to unless the process is running with sudo permissions. We can instead bind to port 0, which will give us a system-defined port in the epemeral range. MozReview-Commit-ID: Ld6BDMhtbck
testing/marionette/components/marionette.js
--- a/testing/marionette/components/marionette.js
+++ b/testing/marionette/components/marionette.js
@@ -282,17 +282,17 @@ MarionetteComponent.prototype.init = fun
 
   if (!prefs.forceLocal) {
     // See bug 800138.  Because the first socket that opens with
     // force-local=false fails, we open a dummy socket that will fail.
     // keepWhenOffline=true so that it still work when offline (local).
     // This allows the following attempt by Marionette to open a socket
     // to succeed.
     let insaneSacrificialGoat =
-        new ServerSocket(666, Ci.nsIServerSocket.KeepWhenOffline, 4);
+        new ServerSocket(0, Ci.nsIServerSocket.KeepWhenOffline, 4);
     insaneSacrificialGoat.asyncListen(this);
   }
 
   let s;
   try {
     Cu.import("chrome://marionette/content/server.js");
     s = new server.TCPListener(prefs.port, prefs.forceLocal);
     s.start();