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

--HG--
extra : rebase_source : 0c2ae692dd675c664898e004c29a0e342fd9755b
This commit is contained in:
Andreas Tolfsen 2017-03-28 16:46:54 +01:00
Родитель 8ecaf68f51
Коммит cc9e1bdd13
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -287,7 +287,7 @@ MarionetteComponent.prototype.init = function () {
// 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);
}