mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-22 12:52:50 +03:00
Fixed bug in execve() on linux and bsd
This commit is contained in:
parent
5fd93b7b41
commit
6629a86339
@ -3906,6 +3906,7 @@ function linux_execv(name, agentfilename, sessionid)
|
||||
var i;
|
||||
var args;
|
||||
var argarr = [process.execPath];
|
||||
var argtmp = [];
|
||||
var path = require('_GenericMarshal').CreateVariable(process.execPath);
|
||||
|
||||
if (require('MeshAgent').getStartupOptions != null) {
|
||||
@ -3918,6 +3919,7 @@ function linux_execv(name, agentfilename, sessionid)
|
||||
args = require('_GenericMarshal').CreateVariable((1 + argarr.length) * require('_GenericMarshal').PointerSize);
|
||||
for (i = 0; i < argarr.length; ++i) {
|
||||
var arg = require('_GenericMarshal').CreateVariable(argarr[i]);
|
||||
argtmp.push(arg);
|
||||
arg.pointerBuffer().copy(args.toBuffer(), i * require('_GenericMarshal').PointerSize);
|
||||
}
|
||||
|
||||
@ -3965,6 +3967,7 @@ function bsd_execv(name, agentfilename, sessionid) {
|
||||
var i;
|
||||
var path = require('_GenericMarshal').CreateVariable(process.execPath);
|
||||
var argarr = [process.execPath];
|
||||
var argtmp = [];
|
||||
var args;
|
||||
var options = require('MeshAgent').getStartupOptions();
|
||||
for (i in options) {
|
||||
@ -3973,6 +3976,7 @@ function bsd_execv(name, agentfilename, sessionid) {
|
||||
args = require('_GenericMarshal').CreateVariable((1 + argarr.length) * require('_GenericMarshal').PointerSize);
|
||||
for (i = 0; i < argarr.length; ++i) {
|
||||
var arg = require('_GenericMarshal').CreateVariable(argarr[i]);
|
||||
argtmp.push(arg);
|
||||
arg.pointerBuffer().copy(args.toBuffer(), i * require('_GenericMarshal').PointerSize);
|
||||
}
|
||||
|
||||
|
@ -237,6 +237,7 @@ function linux_execv(name, agentfilename, sessionid)
|
||||
|
||||
var i;
|
||||
var args;
|
||||
var argtmp = [];
|
||||
var argarr = [process.execPath];
|
||||
var path = require('_GenericMarshal').CreateVariable(process.execPath);
|
||||
|
||||
@ -250,6 +251,7 @@ function linux_execv(name, agentfilename, sessionid)
|
||||
args = require('_GenericMarshal').CreateVariable((1 + argarr.length) * require('_GenericMarshal').PointerSize);
|
||||
for (i = 0; i < argarr.length; ++i) {
|
||||
var arg = require('_GenericMarshal').CreateVariable(argarr[i]);
|
||||
argtmp.push(arg);
|
||||
arg.pointerBuffer().copy(args.toBuffer(), i * require('_GenericMarshal').PointerSize);
|
||||
}
|
||||
|
||||
@ -298,6 +300,7 @@ function bsd_execv(name, agentfilename, sessionid) {
|
||||
var i;
|
||||
var path = require('_GenericMarshal').CreateVariable(process.execPath);
|
||||
var argarr = [process.execPath];
|
||||
var argtmp = [];
|
||||
var args;
|
||||
var options = require('MeshAgent').getStartupOptions();
|
||||
for (i in options) {
|
||||
@ -306,6 +309,7 @@ function bsd_execv(name, agentfilename, sessionid) {
|
||||
args = require('_GenericMarshal').CreateVariable((1 + argarr.length) * require('_GenericMarshal').PointerSize);
|
||||
for (i = 0; i < argarr.length; ++i) {
|
||||
var arg = require('_GenericMarshal').CreateVariable(argarr[i]);
|
||||
argtmp.push(arg);
|
||||
arg.pointerBuffer().copy(args.toBuffer(), i * require('_GenericMarshal').PointerSize);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user