Apply secure log
authorDuyoung Jang <duyoung.jang@samsung.com>
Tue, 11 Jun 2013 01:16:58 +0000 (10:16 +0900)
committerDuyoung Jang <duyoung.jang@samsung.com>
Tue, 11 Jun 2013 01:16:58 +0000 (10:16 +0900)
Change-Id: I47ae2f8e9b3eddecfe6271d387e33e6c76b9f46b
Signed-off-by: Duyoung Jang <duyoung.jang@samsung.com>
inc/InstallerDefs.h
plugin/osp-installer-plugin.cpp
src/Util/InstallerUtil.cpp

index d0e5be2..1b2ef50 100755 (executable)
@@ -23,7 +23,7 @@
 
 #include "InstallerUtil.h"
 
-#define OSP_INSTALLER_VERSION "version=[20130610.3]"
+#define OSP_INSTALLER_VERSION "version=[20130611.1]"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
index d3e39d4..297ec96 100755 (executable)
@@ -63,7 +63,6 @@ static int pkg_plugin_pkg_is_installed(const char *pkg_name)
        bool installed = true;
 
        AppLog("[libtpk] pkg_plugin_pkg_is_installed() is called");
-       AppLog("[libtpk] package=[%s]", pkg_name);
 
        TryCatch(pkg_name, err = PKG_ERROR, "[osp-installer][libtpk] package is null");
 
@@ -106,7 +105,6 @@ static int pkg_plugin_get_pkg_detail_info(const char *pkg_name,
        result r = E_SUCCESS;
 
        AppLog("[libtpk] pkg_plugin_get_pkg_detail_info() is called");
-       AppLog("[libtpk] package=[%s]", pkg_name);
 
        TryCatch(pkg_name, err = PKG_ERROR, "[osp-installer][libtpk] package is null");
 
@@ -163,7 +161,7 @@ long long pkg_get_directory_size(const String& rootPath)
        DIR *dp = NULL;
        struct dirent *ep = NULL;
        struct stat fileinfo;
-       char fileName[FILENAME_MAX] = { 0, };
+       char file[FILENAME_MAX] = { 0, };
        char *pDirName = null;
 
        pDirName = _StringConverter::CopyToCharArrayN(rootPath);
@@ -179,25 +177,25 @@ long long pkg_get_directory_size(const String& rootPath)
                        continue;
                }
 
-               snprintf(fileName, FILENAME_MAX, "%s/%s", pDirName, ep->d_name);
+               snprintf(file, FILENAME_MAX, "%s/%s", pDirName, ep->d_name);
 
-               if (lstat(fileName, &fileinfo) < 0)
+               if (lstat(file, &fileinfo) < 0)
                {
                        continue;
                }
 
                if (S_ISLNK(fileinfo.st_mode))
                {
-                       AppLog("[libtpk] SYMLINK=%s", fileName);
+                       AppLog("[libtpk] SYMLINK=%s", file);
                        total += BLOCK_SIZE;
                        continue;
                }
                else if (S_ISDIR(fileinfo.st_mode))
                {
-                       ret = pkg_get_directory_size(fileName);
+                       ret = pkg_get_directory_size(file);
                        ret += fileinfo.st_size;
                        total += ret;
-                       AppLog("[libtpk] DIR=%s, size=%d[%dK],", fileName, (int)ret, (int)(ret/1024));
+                       AppLog("[libtpk] DIR=%s, size=%d[%dK],", file, (int)ret, (int)(ret/1024));
                }
                else
                {
@@ -212,7 +210,7 @@ long long pkg_get_directory_size(const String& rootPath)
 
                        if (q)
                        {
-                               AppLog("[libtpk] File=%s, size=%d[%dK]", fileName, (q * BLOCK_SIZE), (q * BLOCK_SIZE)/1024);
+                               AppLog("[libtpk] File=%s, size=%d[%dK]", file, (q * BLOCK_SIZE), (q * BLOCK_SIZE)/1024);
                        }
                }
        }
index 5c7413e..72219c3 100755 (executable)
@@ -295,23 +295,23 @@ InstallerUtil::ChangeOwner(const String& filePath)
 }
 
 bool
-InstallerUtil::ChangeDirectoryPermission(const String& filePath, int mode, bool appOwner)
+InstallerUtil::ChangeDirectoryPermission(const String& file, int mode, bool appOwner)
 {
        result r = E_SUCCESS;
        bool res = false;
 
-       res = File::IsFileExist(filePath);
+       res = File::IsFileExist(file);
        if (res == false)
        {
-               AppLog("path=[%ls]: skip", filePath.GetPointer());
+               AppLog("path=[%ls]: skip", file.GetPointer());
                return true;
        }
 
        std::unique_ptr<Directory> pDir(new (std::nothrow) Directory);
        TryReturn(pDir, false, "pDir is null.");
 
-       r = pDir->Construct(filePath);
-       TryReturn(!IsFailed(r), false, "pDir->Construct() failed, filePath=[%ls]", filePath.GetPointer());
+       r = pDir->Construct(file);
+       TryReturn(!IsFailed(r), false, "pDir->Construct() failed, file=[%ls]", file.GetPointer());
 
        std::unique_ptr<DirEnumerator> pDirEnum(pDir->ReadN());
        TryReturn(pDirEnum, false, "pDirEnum is null.");
@@ -326,7 +326,7 @@ InstallerUtil::ChangeDirectoryPermission(const String& filePath, int mode, bool
                        continue;
                }
 
-               String entryDir = filePath;
+               String entryDir = file;
                entryDir += L"/";
                entryDir += entryName;
 
@@ -364,7 +364,7 @@ InstallerUtil::ChangeDirectoryPermission(const String& filePath, int mode, bool
        }
 
        AppLog("path=[%ls], mode=[%04o], appOwner=[%s]",
-                       filePath.GetPointer(), mode, appOwner?"true":"false");
+                       file.GetPointer(), mode, appOwner?"true":"false");
 
        return true;
 }