#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>
* 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.
* 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.
* 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
* \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.
* \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_