mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix check for valid parent id.
Parse as decimal (which means you can't specify --parent-pid in hex, that's fine). And convert back to string to check that the whole string was parsed as an int (i.e. "123foobar" should not be converted to "123"). Thanks Slava and Avital.
This commit is contained in:
@@ -69,8 +69,8 @@ var initKeepalive = function () {
|
||||
// takes the parent process's place before the child process dies.
|
||||
var startCheckForLiveParent = function (parentPid) {
|
||||
if (parentPid) {
|
||||
// Check that we have a pid that looks like an integer.
|
||||
if (+parseInt(parentPid) !== parentPid) {
|
||||
// Check that we have a pid that looks like a decimal integer.
|
||||
if ("" + parseInt(parentPid, 10) !== parentPid) {
|
||||
console.error("--parent-pid must be a valid process ID.");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user