From 9046a946f7cc29cc3d6a61163076090a07da5197 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Wed, 5 Feb 2020 10:31:33 -0800 Subject: [PATCH] Added temporary linux check for login shell, until support is added in BSD and MacOS --- agents/meshcore.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index 5735bf3e..28539c8c 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -1248,8 +1248,15 @@ function createMeshCore(agent) { var options = { type: childProcess.SpawnTypes.TERM, uid: (this.httprequest.protocol == 8) ? require('user-sessions').consoleUid() : null, env: env }; if (this.httprequest.xoptions && this.httprequest.xoptions.requireLogin) { - if (!require('fs').existsSync('/bin/login')) { throw ('Unable to spawn login process'); } - this.httprequest.process = childProcess.execFile('/bin/login', ['login'], options); // Start login shell + if (process.platform == 'linux') + { + if (!require('fs').existsSync('/bin/login')) { throw ('Unable to spawn login process'); } + this.httprequest.process = childProcess.execFile('/bin/login', ['login'], options); // Start login shell + } + else + { + throw ('Login Shell only supported on Linux at this time'); + } } else if (bash) {