Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / security_registration.h
index 996a03e..d4274b9 100644 (file)
@@ -5,10 +5,9 @@
 #ifndef COMMON_SECURITY_REGISTRATION_H_
 #define COMMON_SECURITY_REGISTRATION_H_
 
-#include <boost/filesystem/path.hpp>
-
 #include <sys/types.h>
 
+#include <filesystem>
 #include <string>
 #include <vector>
 
@@ -22,21 +21,32 @@ namespace common_installer {
  * Adapter interface for external Security module used for registering
  * package to security context
  *
+ * \param context installer context contains necessary information
+ * \param error_message extra/detailed error message
+ *
+ * \return true if success
+ */
+bool RegisterSecurityContextForManifest(
+        const common_installer::InstallerContext* context,
+        std::string* error_message);
+
+/**
+ * Adapter interface for external Security module.
+ *
+ * Adapter interface for external Security module used for unregistering
+ * package from security context
+ *
  * \param pkg_id pkgid of given package
- * \param path path of installed package
+ * \param pkg_type type of given package*
  * \param uid uid
- * \param cert_info pointer to certificate info
  * \param manifest pointer to manifest structure
- * \param cross_app_rules true if n-to-n smack rules should be generated
- *                        apps (should be set for hybrid applications).
  * \param error_message extra/detailed error message
  *
  * \return true if success
  */
-bool RegisterSecurityContextForManifest(const std::string& pkg_id,
-    const boost::filesystem::path& path, uid_t uid,
-    common_installer::CertificateInfo* cert_info, manifest_x* manifest,
-    bool cross_app_rules, std::string* error_message);
+bool UnregisterSecurityContextForManifest(const std::string& pkg_id,
+    const std::string& pkg_type, uid_t uid, manifest_x* manifest,
+    std::string* error_message);
 
 /**
  * Adapter interface for external Security module.
@@ -45,14 +55,18 @@ bool RegisterSecurityContextForManifest(const std::string& pkg_id,
  * package from security context
  *
  * \param pkg_id pkgid of given package
+ * \param pkg_type type of given package
  * \param uid uid
- * \param manifest pointer to manifest structure
  * \param error_message extra/detailed error message
+ * \param ignore_data_absence optional, default set to false, indicate if
+ *                            failure of querying appids for pkgid should return
+ *                            false or true
  *
  * \return true if success
  */
-bool UnregisterSecurityContextForManifest(const std::string& pkg_id, uid_t uid,
-    manifest_x* manifest, std::string* error_message);
+bool UnregisterSecurityContextForPkgId(const std::string& pkg_id,
+    const std::string& pkg_type, uid_t uid, std::string* error_message,
+    bool ignore_data_absence = false);
 
 /**
  * Adapter interface for external Security module.
@@ -61,6 +75,7 @@ bool UnregisterSecurityContextForManifest(const std::string& pkg_id, uid_t uid,
  * package path to security context
  *
  * \param pkg_id pkgid of given package
+ * \param pkg_type pkg type of given package
  * \param path path for registering
  * \param uid uid
  * \param is_readonly_pkg RO package flag
@@ -69,8 +84,8 @@ bool UnregisterSecurityContextForManifest(const std::string& pkg_id, uid_t uid,
  * \return true if success
  */
 bool RegisterSecurityContextForPath(const std::string &pkg_id,
-    const boost::filesystem::path& path, uid_t uid,
-    bool is_readonly_pkg, std::string* error_message);
+    const std::string& pkg_type, const std::filesystem::path& path,
+    uid_t uid, bool is_readonly_pkg, std::string* error_message);
 
 /**
  * Adapter interface for external Security module.
@@ -87,9 +102,11 @@ bool RegisterSecurityContextForPath(const std::string &pkg_id,
  * \return true if success
  */
 bool RegisterSecurityContextForPathExternalOnly(const std::string &pkg_id,
-    const std::string &pkg_type, const boost::filesystem::path& path,
+    const std::string &pkg_type, const std::filesystem::path& path,
     uid_t uid, std::string* error_message);
 
+bool HasOwnerRwOtherRoPaths(const std::filesystem::path& path);
+
 }  // namespace common_installer
 
 #endif  // COMMON_SECURITY_REGISTRATION_H_