remove share directory
authorSoyoung Kim <sy037.kim@samsung.com>
Wed, 6 Feb 2013 07:21:03 +0000 (16:21 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 6 Feb 2013 10:25:54 +0000 (19:25 +0900)
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution] remove share directory
[SCMRequest] N/A

src/jobs/widget_install/task_file_manipulation.cpp
src/jobs/widget_install/task_file_manipulation.h
src/misc/widget_location.cpp
src/misc/widget_location.h

index 1748798..82aa151 100644 (file)
@@ -103,7 +103,6 @@ TaskFileManipulation::TaskFileManipulation(InstallerContext& context) :
             m_context.locationType) {
         AddStep(&TaskFileManipulation::StepCreateDirs);
         AddStep(&TaskFileManipulation::StepCreatePrivateStorageDir);
-        AddStep(&TaskFileManipulation::StepCreateShareDir);
         if (m_context.widgetConfig.packagingType !=
                 WrtDB::PKG_TYPE_DIRECTORY_WEB_APP)
         {
@@ -114,7 +113,6 @@ TaskFileManipulation::TaskFileManipulation(InstallerContext& context) :
         AddStep(&TaskFileManipulation::StepPrepareExternalDir);
         AddStep(&TaskFileManipulation::StepInstallToExternal);
         AddStep(&TaskFileManipulation::StepCreatePrivateStorageDir);
-        AddStep(&TaskFileManipulation::StepCreateShareDir);
 
         AddAbortStep(&TaskFileManipulation::StepAbortCreateExternalDir);
     }
@@ -188,49 +186,6 @@ void TaskFileManipulation::StepCreatePrivateStorageDir()
     }
 }
 
-void TaskFileManipulation::StepCreateShareDir()
-{
-    std::string sharePath = m_context.locations->getShareDir();
-
-    if (euidaccess(sharePath.c_str(), F_OK) != 0) {
-        if(!WrtUtilMakeDir(sharePath, SHARE_MODE)){
-            LogError("Failed to create directory for share");
-            ThrowMsg(Exceptions::InternalError,
-                    "Failed to create directory for share");
-        }
-        // '5000' is default uid, gid for applications.
-        // So installed applications should be launched as process of uid '5000'.
-        // the process can access private directory 'data' of itself.
-        if(chown(sharePath.c_str(),
-                 WEBAPP_DEFAULT_UID,
-                 WEBAPP_DEFAULT_GID) != 0)
-        {
-            ThrowMsg(Exceptions::InternalError,
-                 "Chown to invaild user");
-        }
-    } else if (euidaccess(sharePath.c_str(), W_OK | R_OK | X_OK) == 0) {
-        LogInfo("Share directory already exists.");
-        // Even if share directory already is created, share dircetory
-        // should change owner.
-        if(chown(sharePath.c_str(),
-                 WEBAPP_DEFAULT_UID,
-                 WEBAPP_DEFAULT_GID) != 0)
-        {
-            ThrowMsg(Exceptions::InternalError,
-                 "Chown to invaild user");
-        }
-        if(chmod(sharePath.c_str(), SHARE_MODE) != 0) {
-            ThrowMsg(Exceptions::InternalError,
-                 "chmod to 0700");
-        }
-
-    } else {
-        ThrowMsg(Exceptions::InternalError,
-                 "No access to private storage.");
-    }
-
-}
-
 void TaskFileManipulation::StepRenamePath()
 {
     std::string instDir;
index e3f615e..bce099f 100644 (file)
@@ -39,7 +39,6 @@ class TaskFileManipulation :
     void StepCreateDirs();
     void StepRenamePath();
     void StepCreatePrivateStorageDir();
-    void StepCreateShareDir();
 
     void StepAbortRenamePath();
 
index cefdb31..80aa476 100644 (file)
@@ -159,12 +159,6 @@ std::string WidgetLocation::getPrivateStorageDir() const
         WrtDB::GlobalConfig::GetWidgetPrivateStoragePath();
 }
 
-std::string WidgetLocation::getShareDir() const
-{
-    return std::string(WrtDB::GlobalConfig::GetUserInstalledWidgetPath()) + "/"
-            + m_pkgid + "/" + WrtDB::GlobalConfig::GetWidgetSharePath();
-}
-
 std::string WidgetLocation::getTemporaryPackageDir() const
 {
     return m_temp->getTempPath();
index db024b3..324d8e8 100644 (file)
@@ -117,7 +117,6 @@ public:
     std::string getBackupExecFile() const;              // /opt/apps/[package]/backup/bin/[package]
     std::string getUserDataRootDir() const;             // /opt/usr/apps/[package]
     std::string getPrivateStorageDir() const;                 // /opt/usr/apps/[package]/data
-    std::string getShareDir() const;                    // /opt/usr/apps/[package]/share
 
     // Temporary paths
     /**