Added temporary linux check for login shell, until support is added in BSD and MacOS
This commit is contained in:
parent
11796beaaf
commit
be59454ca3
|
@ -1247,10 +1247,17 @@ function createMeshCore(agent) {
|
||||||
}
|
}
|
||||||
var options = { type: childProcess.SpawnTypes.TERM, uid: (this.httprequest.protocol == 8) ? require('user-sessions').consoleUid() : null, env: env };
|
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 (this.httprequest.xoptions && this.httprequest.xoptions.requireLogin)
|
||||||
|
{
|
||||||
|
if (process.platform == 'linux')
|
||||||
{
|
{
|
||||||
if (!require('fs').existsSync('/bin/login')) { throw ('Unable to spawn login process'); }
|
if (!require('fs').existsSync('/bin/login')) { throw ('Unable to spawn login process'); }
|
||||||
this.httprequest.process = childProcess.execFile('/bin/login', ['login'], options); // Start login shell
|
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)
|
else if (bash)
|
||||||
{
|
{
|
||||||
this.httprequest.process = childProcess.execFile(bash, ['bash'], options); // Start as active user
|
this.httprequest.process = childProcess.execFile(bash, ['bash'], options); // Start as active user
|
||||||
|
|
Loading…
Reference in New Issue