Skip to content
Closed
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* If not stated otherwise in this file or this component's Licenses.txt file the

Check failure on line 2 in source/scripts/init/src/apply_system_defaults/apply_system_defaults.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/scripts/init/src/apply_system_defaults/apply_system_defaults.c' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 3565 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/RDKB-TEST-RELEASE-1.tar.gz, file: source/scripts/init/src/apply_system_defaults/apply_system_defaults.c)

Check failure on line 2 in source/scripts/init/src/apply_system_defaults/apply_system_defaults.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/scripts/init/src/apply_system_defaults/apply_system_defaults.c' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 3565 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/scripts/init/src/apply_system_defaults/apply_system_defaults.c)

Check failure on line 2 in source/scripts/init/src/apply_system_defaults/apply_system_defaults.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/scripts/init/src/apply_system_defaults/apply_system_defaults.c' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/2, 3565 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/RDKB-RELEASE-TEST-DUNFELL-2.tar.gz, file: source/scripts/init/src/apply_system_defaults/apply_system_defaults.c)
* following copyright and licenses apply:
*
* Copyright 2015 RDK Management
Expand Down Expand Up @@ -3317,6 +3317,50 @@
}
#endif

#if defined (ONESTACK_PRODUCT_REQ)

#define DEV_PROP_FILE "/etc/device.properties"
static const char *g_dev_prop_params[] = {
"IS_BCI=yes",
NULL
};

static int addPartnerDefaultsToDevPropFile()
{
FILE *fp = NULL;
//check file for existence
if (access(DEV_PROP_FILE, F_OK) != 0)
{
APPLY_PRINT("[Utopia - %s]File %s does not exists\n",__FUNCTION__,DEV_PROP_FILE);
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log message text "File %s does not exists" is grammatically incorrect; it should be "does not exist". Please fix the wording in this message to avoid shipping a user-visible typo.

Suggested change
APPLY_PRINT("[Utopia - %s]File %s does not exists\n",__FUNCTION__,DEV_PROP_FILE);
APPLY_PRINT("[Utopia - %s]File %s does not exist\n",__FUNCTION__,DEV_PROP_FILE);

Copilot uses AI. Check for mistakes.
return 1;
}

//open for writing
fp = fopen(DEV_PROP_FILE, "a");
if (fp == NULL)
{
APPLY_PRINT("[Utopia - %s]File %s could not open for writing\n",__FUNCTION__,DEV_PROP_FILE);
return 1;
}

int i = 0;
for (i = 0; g_dev_prop_params[i] != NULL; i++)
{
if (fprintf(fp, "%s\n", g_dev_prop_params[i]) < 0)
{
Comment on lines +3346 to +3350
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addPartnerDefaultsToDevPropFile always appends IS_BCI=yes to /etc/device.properties on each run without checking whether the key already exists, which will cause duplicate entries to accumulate over time. To keep device.properties clean and the operation idempotent, consider first checking if IS_BCI is already present (e.g., by scanning the file or reusing existing helper logic) and only appending when the key is missing.

Copilot uses AI. Check for mistakes.
APPLY_PRINT("[Utopia - %s]File %s write failed\n",__FUNCTION__,DEV_PROP_FILE);
fclose(fp);
return 1;
}
}

APPLY_PRINT("[Utopia - %s]File %s write successful\n",__FUNCTION__,DEV_PROP_FILE);

fclose(fp);

return 0;
}
#endif
/*
* main()
*/
Expand Down Expand Up @@ -3531,6 +3575,16 @@

sysevent_close(global_fd, global_id);

#if defined (ONESTACK_PRODUCT_REQ)
if (0 == strcasecmp (PartnerID, "comcast-business"))
{
if ( 1 == addPartnerDefaultsToDevPropFile())
{
APPLY_PRINT("%s - Failed to write default props to '%s'\n", __FUNCTION__, DEV_PROP_FILE);
Comment on lines +3578 to +3583
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new ONESTACK-specific behavior that updates /etc/device.properties based on the PartnerID (via addPartnerDefaultsToDevPropFile when PartnerID is "comcast-business") is not covered by the existing apply_system_defaults unit tests, even though this component already has a gtest suite. Consider adding unit tests (e.g., under source/test/apply_system_defaults) that exercise this path and validate that IS_BCI is written to the properties file when the appropriate partner ID is set, and that failures are logged correctly.

Copilot uses AI. Check for mistakes.
}
}
#endif

return(0);
}

Loading