Skip to content

Rebase #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
03152be
Update remote_debugger.json
Abhinavpv28 Feb 26, 2025
1ae23c6
Merge pull request #81 from rdkcentral/develop
Abhinavpv28 Feb 26, 2025
3ba2805
Update rrdCommandSanity.c
Abhinavpv28 Feb 26, 2025
afa6d6e
Update remote_debugger.json
Abhinavpv28 Feb 26, 2025
d63df34
Update rrdCommandSanity.c
Abhinavpv28 Feb 27, 2025
987fdd6
Update rrdCommandSanity.c
Abhinavpv28 Feb 27, 2025
79f8558
Update rrdCommandSanity.c
Abhinavpv28 Feb 28, 2025
988d79a
Update rrdCommandSanity.c
Abhinavpv28 Feb 28, 2025
7c1592d
Update rrdCommandSanity.c
Abhinavpv28 Feb 28, 2025
54bdd85
Update rrdCommandSanity.c
Abhinavpv28 Feb 28, 2025
62b3269
Update rrdCommandSanity.c
Abhinavpv28 Mar 1, 2025
39d5905
Update rrdCommandSanity.c
Abhinavpv28 Mar 1, 2025
e32b3c2
Update rrdCommandSanity.c
Abhinavpv28 Mar 1, 2025
a517abc
Update rrdCommandSanity.c
Abhinavpv28 Mar 1, 2025
9b6faea
Update rrdCommandSanity.c
Abhinavpv28 Mar 1, 2025
03a96ef
Update rrdJsonParser.c
Abhinavpv28 Mar 7, 2025
61b3ceb
Update rrdJsonParser.c
Abhinavpv28 Mar 7, 2025
e5d0586
Merge pull request #90 from rdkcentral/develop
Abhinavpv28 Mar 7, 2025
67fdd2c
Update rrdInterface.c
Abhinavpv28 Mar 7, 2025
d08d6ed
Update rrdInterface.c
Abhinavpv28 Mar 7, 2025
104f0c2
Update rrdInterface.c
Abhinavpv28 Mar 7, 2025
fdbfe59
Update rrdInterface.c
Abhinavpv28 Mar 7, 2025
f4df85a
Update rrdJsonParser.c
Abhinavpv28 Mar 7, 2025
99b32f5
Update rrdInterface.c
Abhinavpv28 Mar 7, 2025
a24f846
Merge branch 'develop' into feature/RDKEMW-1768
Abhinavpv28 Mar 8, 2025
8164e35
Update rrdInterface.c
Abhinavpv28 Mar 8, 2025
e7c98c6
Update rrdInterface.c
Abhinavpv28 Mar 8, 2025
d8a3589
Update rrdInterface.c
Abhinavpv28 Mar 8, 2025
8fe4f61
Update rrdJsonParser.c
Abhinavpv28 Mar 8, 2025
3ed4591
Update rrdJsonParser.c
Abhinavpv28 Mar 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/rrdCommandSanity.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#include "rrdCommandSanity.h"
#include <ctype.h>

/*
* @function updateBackgroundCmd
Expand Down Expand Up @@ -131,9 +132,22 @@ int isCommandsValid(char *issuecmd,cJSON *sanitylist)
{
subcmd = cJSON_GetArrayItem(sanitylist, i);
checkcmd = cJSON_Print(subcmd); // Print each command from the sanity command array in Json
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Checking for \"%s\" string in Issue commands... \n",__FUNCTION__,__LINE__,checkcmd);
int len = strlen(checkcmd);
if (len >= 2 && checkcmd[0] == '"' && checkcmd[len - 1] == '"')
{
checkcmd[len - 1] = '\0'; // Remove closing quote
checkcmd++; // Move pointer forward to skip opening quote
len -= 2; // Adjust length after removing quotes
}
// Trim trailing spaces
int j = len - 1;
while (j >= 0 && isspace(checkcmd[j])) {
checkcmd[j] = '\0';
j--;
}
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Checking for \"%s\" string in Issue commands...issue_command : \"%s\" \n",__FUNCTION__,__LINE__,checkcmd, issuecmd);
sanitystr = strstr(issuecmd,checkcmd);
cJSON_free(checkcmd); // free each command from the sanity command array
//cJSON_free(checkcmd); // free each command from the sanity command array
if (sanitystr)
{
RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]: Found harmful commands: %s, Exiting!!! \n",__FUNCTION__,__LINE__,sanitystr);
Expand Down
4 changes: 2 additions & 2 deletions src/rrdInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ void _rdmDownloadEventHandler(rbusHandle_t handle, rbusEvent_t const* event, rbu
if(retCode != RBUS_ERROR_SUCCESS || value == NULL)
{
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: RBUS get failed for the event [%s]\n", __FUNCTION__, __LINE__, RRD_SET_ISSUE_EVENT);
return;
}
return;
}
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: issue type_value: = [%s]\n", __FUNCTION__, __LINE__, rbusValue_GetString(value, NULL));
issue =rbusValue_GetString(value, NULL);
size_t len = strlen(RDM_PKG_PREFIX) + strlen(issue) + 1;
Expand Down
21 changes: 21 additions & 0 deletions src/rrdJsonParser.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,22 @@ issueData * getIssueCommandInfo(issueNodeData *issuestructNode, cJSON *jsoncfg,
}
else
{
jsoncfg = readAndParseJSON(RRD_JSON_FILE);
sanity = cJSON_GetObjectItem(jsoncfg, "Sanity");
check = cJSON_GetObjectItem(sanity, "Check");
checkval = cJSON_Print(check); // Print list of sanity commands received
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Reading Sanity Check Commands List: \n%s\n",__FUNCTION__,__LINE__,checkval);
/*
if(checkval ==NULL)
{
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Entering checkval null case : \n",__FUNCTION__,__LINE__);
jsoncfg = readAndParseJSON(RRD_JSON_FILE);
sanity = cJSON_GetObjectItem(jsoncfg, "Sanity");
check = cJSON_GetObjectItem(sanity, "Check");
checkval = cJSON_Print(check); // Print list of sanity commands received
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Reading Sanity Check Commands List: \n%s\n",__FUNCTION__,__LINE__,checkval);
}
*/
cmdlist = cJSON_GetObjectItem(check, "Commands");
cJSON_free(checkval); // free sanity command list
ret = isCommandsValid(issuestdata->command, cmdlist);
Expand Down Expand Up @@ -430,6 +442,15 @@ bool invokeSanityandCommandExec(issueNodeData *issuestructNode, cJSON *jsoncfg,
check = cJSON_GetObjectItem(sanity, "Check");
checkval = cJSON_Print(check); // Print list of sanity commands received
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Reading Sanity Check Commands List: \n%s\n",__FUNCTION__,__LINE__,checkval);
if(checkval ==NULL)
{
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Entering checkval null case : \n",__FUNCTION__,__LINE__);
jsoncfg = readAndParseJSON(RRD_JSON_FILE);
sanity = cJSON_GetObjectItem(jsoncfg, "Sanity");
check = cJSON_GetObjectItem(sanity, "Check");
checkval = cJSON_Print(check); // Print list of sanity commands received
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Reading Sanity Check Commands List: \n%s\n",__FUNCTION__,__LINE__,checkval);
}
cmdlist = cJSON_GetObjectItem(check, "Commands");
cJSON_free(checkval); // free sanity command list
ret = isCommandsValid(issuestdata->command, cmdlist);
Expand Down
Loading