-
Notifications
You must be signed in to change notification settings - Fork 3
RDKEMW-11792 : FFV config file isolation #165
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes OEM-specific configuration file integration from the build process as part of FFV (likely "Firmware Version") config file isolation. The change removes two parameters from the JSON configuration merge command that previously incorporated OEM customizations.
- Removes OEM configuration substitution and addition parameters from the build-time JSON combine step
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
src/voice/ctrlm_voice_obj.h:747
- The function declaration for
vsdk_keyword_sensitivity_limit_checkremains in the header file but its implementation has been removed fromctrlm_voice_obj.cpp. This will cause a linker error if any code attempts to call this function. Remove this declaration from the header file.
double vsdk_keyword_sensitivity_limit_check(double sensitivity);
src/ctrlm_main.cpp:1631
- The root JSON object is retrieved before the OEM configuration is appended (line 1646). While this works because json_from_path returns a reference to the internal root object which is modified in-place by append_config, it creates confusing code flow. Consider moving this call after the OEM config append operation for clarity, or add a comment explaining why this order is intentional.
*json_obj_root = ctrlm_config->json_from_path("", true); // Get root AND add ref to it, since this code derefs it
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ub-rdkcentral:rdkcentral/control into feature/RDKEMW-11792_ffv_config_file_isolation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/voice/ctrlm_voice_obj.h:747
- The function declaration for vsdk_keyword_sensitivity_limit_check should be removed since its implementation has been deleted. This leftover declaration will cause linking errors if anyone attempts to use it.
double vsdk_keyword_sensitivity_limit_check(double sensitivity);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| XLOGD_ERROR("JSON ERROR: Line <%u> Column <%u> Text <%s> Contents <%s>", json_error.line, json_error.column, json_error.text, contents.c_str()); | ||
| } |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSON parse error log now includes the full config file contents. This can be very large and may leak sensitive data into logs. Consider truncating the logged contents and/or only including it when verbose is enabled.
| } | ||
|
|
||
| //Extract the vsdk configuration object |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the vsdk extraction block immediately below this section, the code sets json_obj_vsdk = NULL when the JSON value is missing or not an object. That only clears the local pointer variable, not the out-param; if the value exists but is the wrong type, callers can still receive a non-object *json_obj_vsdk. Update that branch to clear *json_obj_vsdk instead.
| // Print the configuration since it was loaded from files | ||
| char *json_dump = json_dumps(*json_obj_root, JSON_INDENT(3) | JSON_SORT_KEYS); | ||
| if(json_dump == NULL) { | ||
| XLOGD_ERROR("unable to dump JSON object"); | ||
| json_decref(*json_obj_root); | ||
| *json_obj_root = NULL; | ||
| return(false); | ||
| } else { | ||
| XLOGD_INFO_OPTS(XLOG_OPTS_DEFAULT, 20 * 1024, "Final configuration:\n%s", json_dump); | ||
| free(json_dump); | ||
| } |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dumping the entire merged configuration to logs can expose secrets/PII (e.g., device_id, endpoints, auth URLs) in production. Consider gating this behind a debug/verbose flag, masking sensitive fields before logging, or removing the full dump entirely.
| // Print the configuration since it was loaded from files | |
| char *json_dump = json_dumps(*json_obj_root, JSON_INDENT(3) | JSON_SORT_KEYS); | |
| if(json_dump == NULL) { | |
| XLOGD_ERROR("unable to dump JSON object"); | |
| json_decref(*json_obj_root); | |
| *json_obj_root = NULL; | |
| return(false); | |
| } else { | |
| XLOGD_INFO_OPTS(XLOG_OPTS_DEFAULT, 20 * 1024, "Final configuration:\n%s", json_dump); | |
| free(json_dump); | |
| } | |
| // Configuration successfully loaded and validated at this point |
| json_t *append_root = json_loads(contents.c_str(), JSON_REJECT_DUPLICATES, &json_error); | ||
| if(append_root == NULL) { | ||
| XLOGD_ERROR("JSON ERROR: Line <%u> Column <%u> Text <%s> Contents <%s>", json_error.line, json_error.column, json_error.text, contents.c_str()); | ||
| } else { | ||
| if(json_object_update(this->root, append_root) != 0) { | ||
| XLOGD_ERROR("Failed to merge JSON objects"); | ||
| } else { | ||
| if(verbose) { | ||
| XLOGD_INFO("config appended successfully as JSON for <%s>", file_path.c_str()); | ||
| } | ||
| ret = true; | ||
| } | ||
| json_decref(append_root); |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
append_config() uses json_object_update(), which overwrites top-level keys and replaces nested objects wholesale. If the OPT file is intended to override only a subset of an OEM section (common for config overrides), this will drop the rest of the OEM subtree. Use a recursive merge (e.g., json_object_update_recursive() or equivalent custom deep-merge) to preserve existing nested keys while overriding only those provided.
| install(TARGETS controlMgr RUNTIME DESTINATION bin) | ||
|
|
||
| install(FILES ${CMAKE_BINARY_DIR}/ctrlm_config.json.template DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} COMPONENT config ) | ||
| install(FILES ${CMAKE_BINARY_DIR}/ctrlm_config.json DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} COMPONENT config ) |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctrlm_load_config() now loads OEM config from /etc/vendor/input/ctrlm_config.json, but the build installs ctrlm_config.json to ${CMAKE_INSTALL_SYSCONFDIR} (typically /etc). This mismatch means the installed config may never be read at runtime. Align the install destination with the runtime search path (or update the runtime path to match the install).
No description provided.