Added temporary linux check for login shell, until support is added in BSD and MacOS
Bryan Roe committed
Feb 5, 2020 at 10:31 UTC
be59454ca3e9b6f92ffcdac3f113684fc0bb530e
1 file changed
+9
-2
agents/meshcore.js
+9
-2
@@ -1248,8 +1248,15 @@ function createMeshCore(agent) {
1248
var options = { type: childProcess.SpawnTypes.TERM, uid: (this.httprequest.protocol == 8) ? require('user-sessions').consoleUid() : null, env: env };
1249
if (this.httprequest.xoptions && this.httprequest.xoptions.requireLogin)
1250
{
1251
- if (!require('fs').existsSync('/bin/login')) { throw ('Unable to spawn login process'); }
1252
- this.httprequest.process = childProcess.execFile('/bin/login', ['login'], options); // Start login shell
1251
+ if (process.platform == 'linux')
1252
+ {
1253
+ if (!require('fs').existsSync('/bin/login')) { throw ('Unable to spawn login process'); }
1254
+ this.httprequest.process = childProcess.execFile('/bin/login', ['login'], options); // Start login shell
1255
+ }
1256
+ else
1257
+ {
1258
+ throw ('Login Shell only supported on Linux at this time');
1259
+ }
1260
}
1261
else if (bash)
1262
{