Revert "Fix smack labeling for lib rpk"
[platform/core/appfw/app-installers.git] / src / common / security_registration.cc
index 1204e3d..3a526e7 100644 (file)
@@ -379,19 +379,6 @@ class SecurityContextPathRequest {
         SetErrorMessage(&error_message_, error);
         return false;
       }
-
-      // this is for lib rpk installation. set public RO for contents only.
-      if (pkg_type == "rpk" && std::string(policy.first) == "lib") {
-        for (fs::directory_iterator iter(subpath);
-            iter != fs::directory_iterator(); ++iter) {
-          error = security_manager_path_req_add_path(req_,
-              iter->path().string().c_str(), SECURITY_MANAGER_PATH_PUBLIC_RO);
-          if (error!= SECURITY_MANAGER_SUCCESS) {
-            SetErrorMessage(&error_message_, error);
-            return false;
-          }
-        }
-      }
     }
     return true;
   }
@@ -559,8 +546,8 @@ bool UnregisterSecurityContextForPkgId(const std::string &pkg_id,
 }
 
 bool RegisterSecurityContextForPath(const std::string &pkg_id,
-    const std::string& pkg_type, const std::filesystem::path& path,
-    uid_t uid, bool is_readonly_pkg, std::string* error_message) {
+    const std::filesystem::path& path, uid_t uid, bool is_readonly_pkg,
+    std::string* error_message) {
   SecurityContextPathRequest req;
   if (!req.IsValid()) {
     *error_message = req.ErrorMessage();
@@ -570,7 +557,7 @@ bool RegisterSecurityContextForPath(const std::string &pkg_id,
     *error_message = req.ErrorMessage();
     return false;
   }
-  if (!req.PreparePath(pkg_type, path, is_readonly_pkg, false)) {
+  if (!req.PreparePath({}, path, is_readonly_pkg, false)) {
     *error_message = req.ErrorMessage();
     return false;
   }