errorCodeToMsg

This commit is contained in:
maxdcb
2026-04-30 14:17:48 +02:00
parent 853edb4d33
commit 2458165b9f
28 changed files with 2754 additions and 2391 deletions
+8
View File
@@ -94,6 +94,12 @@ int Shell::followUp(const C2Message &c2RetMessage)
int Shell::errorCodeToMsg(const C2Message &c2RetMessage, std::string &errorMsg)
{
if(c2RetMessage.errorCode() > 0)
{
errorMsg = c2RetMessage.returnvalue().empty()
? "Failed to start shell."
: c2RetMessage.returnvalue();
}
return 0;
}
@@ -211,6 +217,7 @@ int Shell::process(C2Message &c2Message, C2Message &c2RetMessage)
if(startShell() != 0)
{
c2RetMessage.set_errorCode(1);
c2RetMessage.set_returnvalue("Failed to start shell.");
return 0;
}
if(cmd.empty())
@@ -279,6 +286,7 @@ int Shell::process(C2Message &c2Message, C2Message &c2RetMessage)
if(startShell() != 0)
{
c2RetMessage.set_errorCode(1);
c2RetMessage.set_returnvalue("Failed to start shell.");
return 0;
}
if(cmd.empty())