bool PreparePathRequest(const std::string& pkg_id,
const boost::filesystem::path& path, uid_t uid, path_req* req,
- bool readonly, std::string* error_message) {
+ bool is_readonly_pkg, std::string* error_message) {
if (pkg_id.empty() || path.empty()) {
LOG(ERROR) << "Pkgid or path is empty. Both values must be set";
return false;
return false;
}
// When registering skel dir on global installation mode
- if (type == SM_APP_INSTALL_PRELOADED && !readonly)
+ if (type == SM_APP_INSTALL_PRELOADED && !is_readonly_pkg)
type = SM_APP_INSTALL_GLOBAL;
error = security_manager_path_req_set_install_type(req, type);
bool RegisterSecurityContextForPath(const std::string &pkg_id,
const boost::filesystem::path& path, uid_t uid,
- bool readonly, std::string* error_message) {
+ bool is_readonly_pkg, std::string* error_message) {
path_req* req;
int error = security_manager_path_req_new(&req);
if (error != SECURITY_MANAGER_SUCCESS) {
return false;
}
- if (!PreparePathRequest(pkg_id, path, uid, req, readonly, error_message)) {
+ if (!PreparePathRequest(pkg_id, path, uid, req, is_readonly_pkg,
+ error_message)) {
LOG(ERROR) << "Failed while preparing security_manager_app_inst_req";
security_manager_path_req_free(req);
return false;
* Adapter interface for external Security module.
*
* Adapter interface for external Security module used for registering
- * application to security context
- *
- * \param app_id id of given application
- * \param pkg_id id of given package
- * \param author_id unique author id of given package
- * \param api_version api-version of given package
- * \param path path of installed package
- * \param uid uid
- * \param privileges 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 RegisterSecurityContext(const std::string& app_id,
- const std::string& pkg_id, const std::string& author_id,
- const std::string& api_version, const boost::filesystem::path& path,
- uid_t uid, const std::vector<std::string>& privileges,
- bool cross_app_rules, std::string* error_message);
-
-/**
- * Adapter interface for external Security module.
- *
- * Adapter interface for external Security module used for unregistering
- * application from security context
- *
- * \param app_id id of given application
- * \param pkg_id id of given package
- * \param uid uid
- * \param error_message extra/detailed error message
- *
- * \return true if success
- */
-bool UnregisterSecurityContext(const std::string& app_id,
- const std::string& pkg_id, uid_t uid, std::string* error_message);
-
-/**
- * Adapter interface for external Security module.
- *
- * Adapter interface for external Security module used for registering
* package to security context
*
* \param pkg_id pkgid of given package
/**
* 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 uid uid
- * \param error_message extra/detailed error message
- *
- * \return true if success
- */
-bool UnregisterSecurityContextForPkgId(const std::string& pkg_id, uid_t uid,
- std::string* error_message);
-
-/**
- * Adapter interface for external Security module.
- *
* Adapter interface for external Security module used for registering
* package path to security context
*
* \param pkg_id pkgid of given package
* \param path path for registering
* \param uid uid
- * \param readonly RO package flag
+ * \param is_readonly_pkg RO package flag
* \param error_message extra/detailed error message
*
* \return true if success
*/
bool RegisterSecurityContextForPath(const std::string &pkg_id,
const boost::filesystem::path& path, uid_t uid,
- bool readonly, std::string* error_message);
+ bool is_readonly_pkg, std::string* error_message);
} // namespace common_installer
break;
}
}
- if (!common_installer::CreateSkelDirectories(package_id,
- str_ver, trusted, shareddata, context_->is_readonly_package.get())) {
- LOG(ERROR) << "Failed to create skel dirs";
- return Status::APP_DIR_ERROR;
+ // Now, /etc/skel is RO mounted region, so we should skip the creation.
+ if (!context_->partial_rw.get()) {
+ if (!common_installer::CreateSkelDirectories(package_id,
+ str_ver, trusted, shareddata, context_->is_readonly_package.get())) {
+ LOG(ERROR) << "Failed to create skel dirs";
+ return Status::APP_DIR_ERROR;
+ }
}
if (!CopyUserDirectories(package_id)) {