mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 15:53:55 +00:00
Fixed build for No_OpenSSL build mode
This commit is contained in:
@@ -1643,7 +1643,7 @@ duk_ret_t ILibDuktape_MeshAgent_ServerInfo(duk_context *ctx)
|
|||||||
|
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
#ifndef MICROSTACK_NOTLS
|
||||||
duk_ret_t ILibDuktape_MeshAgent_GenerateCertsForDiagnosticAgent(duk_context *ctx)
|
duk_ret_t ILibDuktape_MeshAgent_GenerateCertsForDiagnosticAgent(duk_context *ctx)
|
||||||
{
|
{
|
||||||
char tmp[UTIL_SHA384_HASHSIZE];
|
char tmp[UTIL_SHA384_HASHSIZE];
|
||||||
@@ -1736,6 +1736,7 @@ duk_ret_t ILibDuktape_MeshAgent_GenerateCertsForDiagnosticAgent(duk_context *ctx
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
duk_ret_t ILibDuktape_MeshAgent_forceExit(duk_context *ctx)
|
duk_ret_t ILibDuktape_MeshAgent_forceExit(duk_context *ctx)
|
||||||
{
|
{
|
||||||
@@ -3820,6 +3821,7 @@ int MeshAgent_AgentMode(MeshAgentHostContainer *agentHost, int paramLen, char **
|
|||||||
{
|
{
|
||||||
agentHost->capabilities |= MeshCommand_AuthInfo_CapabilitiesMask_RECOVERY; parseCommands = 0;
|
agentHost->capabilities |= MeshCommand_AuthInfo_CapabilitiesMask_RECOVERY; parseCommands = 0;
|
||||||
}
|
}
|
||||||
|
#ifndef MICROSTACK_NOTLS
|
||||||
if (strcmp(param[ri], "-nocertstore") == 0)
|
if (strcmp(param[ri], "-nocertstore") == 0)
|
||||||
{
|
{
|
||||||
parseCommands = 0;
|
parseCommands = 0;
|
||||||
@@ -3828,6 +3830,7 @@ int MeshAgent_AgentMode(MeshAgentHostContainer *agentHost, int paramLen, char **
|
|||||||
agentHost->noCertStore = 1;
|
agentHost->noCertStore = 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3871,15 +3874,42 @@ int MeshAgent_AgentMode(MeshAgentHostContainer *agentHost, int paramLen, char **
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
paramLen -= ixr;
|
paramLen -= ixr;
|
||||||
|
if (installFlag != 0)
|
||||||
|
{
|
||||||
|
int bufLen = 0;
|
||||||
|
char *buf;
|
||||||
|
duk_context *ctxx = ILibDuktape_ScriptContainer_InitializeJavaScriptEngineEx(0, 0, agentHost->chain, NULL, NULL, agentHost->exePath, NULL, NULL, NULL);
|
||||||
|
duk_eval_string(ctxx, "require('user-sessions').isRoot();");
|
||||||
|
if (!duk_get_boolean(ctxx, -1))
|
||||||
|
{
|
||||||
|
printf(" Administrator permissions needed...\n");
|
||||||
|
installFlag = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
switch (installFlag)
|
switch (installFlag)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bufLen = ILibSimpleDataStore_Cached_GetJSONEx(agentHost->masterDb, NULL, 0);
|
||||||
|
buf = (char*)ILibMemory_SmartAllocate(bufLen);
|
||||||
|
bufLen = ILibSimpleDataStore_Cached_GetJSONEx(agentHost->masterDb, buf, bufLen);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ILibMemory_Free(buf);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
duk_destroy_heap(ctxx);
|
||||||
|
}
|
||||||
|
|
||||||
agentHost->httpClientManager = ILibCreateWebClient(3, agentHost->chain);
|
agentHost->httpClientManager = ILibCreateWebClient(3, agentHost->chain);
|
||||||
|
|
||||||
|
|||||||
@@ -1073,9 +1073,10 @@ void ILibDuktape_ScriptContainer_Process_Init(duk_context *ctx, char **argList)
|
|||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
ILibDuktape_EventEmitter *emitter;
|
ILibDuktape_EventEmitter *emitter;
|
||||||
|
#ifndef MICROSTACK_NOTLS
|
||||||
char *sslv = (char*)SSLeay_version(SSLEAY_VERSION);
|
char *sslv = (char*)SSLeay_version(SSLEAY_VERSION);
|
||||||
char *sslvS = strstr(sslv, " ") + 1;
|
char *sslvS = strstr(sslv, " ") + 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
duk_push_global_object(ctx); // [g]
|
duk_push_global_object(ctx); // [g]
|
||||||
duk_push_object(ctx); // [g][process]
|
duk_push_object(ctx); // [g][process]
|
||||||
@@ -1127,6 +1128,8 @@ void ILibDuktape_ScriptContainer_Process_Init(duk_context *ctx, char **argList)
|
|||||||
duk_put_prop_string(ctx, -2, "SIGTABLE");
|
duk_put_prop_string(ctx, -2, "SIGTABLE");
|
||||||
|
|
||||||
duk_push_object(ctx);
|
duk_push_object(ctx);
|
||||||
|
|
||||||
|
#ifndef MICROSTACK_NOTLS
|
||||||
if (sslvS != ((char*)NULL + 1))
|
if (sslvS != ((char*)NULL + 1))
|
||||||
{
|
{
|
||||||
char *tmp = strstr(sslvS, " ");
|
char *tmp = strstr(sslvS, " ");
|
||||||
@@ -1136,6 +1139,8 @@ void ILibDuktape_ScriptContainer_Process_Init(duk_context *ctx, char **argList)
|
|||||||
duk_put_prop_string(ctx, -2, "openssl");
|
duk_put_prop_string(ctx, -2, "openssl");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
duk_push_string(ctx, DUK_GIT_DESCRIBE); duk_put_prop_string(ctx, -2, "duktape");
|
duk_push_string(ctx, DUK_GIT_DESCRIBE); duk_put_prop_string(ctx, -2, "duktape");
|
||||||
if (SOURCE_COMMIT_DATE != NULL)
|
if (SOURCE_COMMIT_DATE != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user