upgrade-apply-deltafs: Remove unused function and sensitive data 75/315275/3 accepted/tizen/unified/20240731.160154 accepted/tizen/unified/dev/20240805.054509 accepted/tizen/unified/x/20240801.044233
authorSangYoun Kwak <sy.kwak@samsung.com>
Mon, 29 Jul 2024 09:12:42 +0000 (18:12 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Tue, 30 Jul 2024 05:25:00 +0000 (14:25 +0900)
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 <sy.kwak@samsung.com>
src/upgrade-apply-deltafs/engine/SS_FSUpdate.c
src/upgrade-apply-deltafs/engine/SS_UPI.c

index dc946c6cb6566a676a702e4fdd1c6ca591c4f16a..3b27de18dc669ff93e8b156db6814fa893fda845 100644 (file)
@@ -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;
index d36b864e25700ac3b01b27bbbf592ef189591960..880af0850cfe2135ab617fd505b7b0b691a25bf8 100644 (file)
@@ -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)
 {