From: SangYoun Kwak Date: Mon, 29 Jul 2024 09:12:42 +0000 (+0900) Subject: upgrade-apply-deltafs: Remove unused function and sensitive data X-Git-Tag: accepted/tizen/unified/20240731.160154^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d087d9cb2a64b51e98c3c3f32fd6fd66e783c10;p=platform%2Fcore%2Fsystem%2Fupgrade.git upgrade-apply-deltafs: Remove unused function and sensitive data The function SS_FSAvailiableFreeSpace is not used anywhere so it can be removed. Also this function prints f_bfree, which is a sensitive value from statfs so it is removed too. Another sensitive data from statfs f_bavail is printed as a log, this log is also removed. Change-Id: Ic95f76742c95d19bf2146d6bbb45c8372ef10d7c Signed-off-by: SangYoun Kwak --- diff --git a/src/upgrade-apply-deltafs/engine/SS_FSUpdate.c b/src/upgrade-apply-deltafs/engine/SS_FSUpdate.c index dc946c6..3b27de1 100644 --- a/src/upgrade-apply-deltafs/engine/SS_FSUpdate.c +++ b/src/upgrade-apply-deltafs/engine/SS_FSUpdate.c @@ -1055,8 +1055,6 @@ SS_GetAvailableFreeSpace(const char *partition_name, *available_flash_size = ((long long)vfs.f_bsize * (long long)vfs.f_bavail >= (long long)SIZE_4GB) ? SIZE_4GB : vfs.f_bsize * vfs.f_bavail; if (*available_flash_size == 0) { *available_flash_size = 0x80000; //Same as Legecy RB - LOGE("available_flash_size=%u(vfs.f_bsize=%d vfs.f_bavail=%d\n", - (unsigned int)*available_flash_size, (int)vfs.f_bsize, (int)vfs.f_bavail); return 0; // Same as Legecy RB } return 0; diff --git a/src/upgrade-apply-deltafs/engine/SS_UPI.c b/src/upgrade-apply-deltafs/engine/SS_UPI.c index d36b864..880af08 100644 --- a/src/upgrade-apply-deltafs/engine/SS_UPI.c +++ b/src/upgrade-apply-deltafs/engine/SS_UPI.c @@ -1624,45 +1624,6 @@ cleanup: return SS_GetUpgradeState(); } -/*! - ********************************************************************************* - * SS_FSUpdatemain - ********************************************************************************* - * - * @brief - * This is the API exposed from the engine to update FS. - * FS entry function for updating FS partition. Should be invoked only after verification of the partition - * - * - * @param Requires common data structure having all details & Partition Index. - * (Used for getting right NODES information that built during verification) - * (Configuration, Delta info, Partition Info, UI link , Kind of operation.(Verify or Updates)) - * - * @return returns S_SS_SUCCESS - * E_SS_FAILURE in case of error - * - ********************************************************************************* - */ -size_t SS_FSAvailiableFreeSpace(char *block_name) -{ - - struct mntent *ent; - FILE *aFile; - struct statfs sb; - aFile = setmntent("/proc/mounts", "r"); - if (aFile == NULL) { - LOGE("setmntent error\n"); - return E_SS_FAILURE; - } - while (NULL != (ent = getmntent(aFile))) { - if (strcmp(ent->mnt_fsname, block_name) == 0) { - if (statfs(ent->mnt_dir, &sb) == 0) - LOGL(LOG_SSENGINE, "Total free space = %" PRIu64 ", blocks free = %" PRIu64 "\n", sb.f_bsize * sb.f_bavail, sb.f_bfree); - } - } - endmntent(aFile); - return ((long long)sb.f_bsize * (long long)sb.f_bavail >= (long long)SIZE_4GB) ? SIZE_4GB : sb.f_bsize * sb.f_bavail ; -} int SS_FSVerifyPartition(ua_dataSS_t * ua_dataSS) {