X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcommon%2Finclude%2Fsmack-rules.h;h=5aadc12ac516451a4fe71c8c1b76d169fa49c868;hb=f868403e420691aa3c65173e5c75d9c7351c7d1d;hp=91446a7ce90044f7f6fadfdb319c83ea4a528c0d;hpb=0a18023646c011eeb05abea4ec12fa1c5229728a;p=platform%2Fcore%2Fsecurity%2Fsecurity-manager.git diff --git a/src/common/include/smack-rules.h b/src/common/include/smack-rules.h index 91446a7..5aadc12 100644 --- a/src/common/include/smack-rules.h +++ b/src/common/include/smack-rules.h @@ -45,8 +45,9 @@ public: const std::string &allowPermissions, const std::string &denyPermissions); void loadFromFile(const std::string &path); void addFromTemplate(const std::vector &templateRules, - const std::string &appId, const std::string &pkgId); - void addFromTemplateFile(const std::string &appId, const std::string &pkgId); + const std::string &appId, const std::string &pkgId, const std::string &zoneId); + void addFromTemplateFile(const std::string &appId, const std::string &pkgId, + const std::string &zoneId); void apply() const; void clear() const; @@ -59,8 +60,10 @@ public: * correct permissions to shared data. * * @param[in] pkgContents - a list of all applications inside this package + * @param[in] zoneId - ID of zone which requested application install */ - void generatePackageCrossDeps(const std::vector &pkgContents); + void generatePackageCrossDeps(const std::vector &pkgContents, + const std::string &zoneId); /** * Install package-specific smack rules. @@ -74,6 +77,20 @@ public: */ static void installApplicationRules(const std::string &appId, const std::string &pkgId, const std::vector &pkgContents); + + /** + * Install package-specific smack rules. + * + * Function creates smack rules using predefined template. Rules are applied + * to the kernel and saved on persistent storage so they are loaded on system boot. + * + * @param[in] appId - application id that is beeing installed + * @param[in] pkgId - package id that the application is in + * @param[in] pkgContents - a list of all applications in the package + * @param[in] zoneId - ID of zone which requested application install + */ + static void installApplicationRules(const std::string &appId, const std::string &pkgId, + const std::vector &pkgContents, const std::string &zoneId); /** * Uninstall package-specific smack rules. * @@ -97,9 +114,10 @@ public: * @param[in] appId - application id * @param[in] pkgId - package id that the application belongs to * @param[in] appsInPkg - a list of other applications in the same package id that the application belongs to + * @param[in] zoneId - ID of zone which requested application uninstall */ static void uninstallApplicationRules(const std::string &appId, const std::string &pkgId, - std::vector appsInPkg); + std::vector appsInPkg, const std::string &zoneId); /** * Update package specific rules @@ -110,8 +128,10 @@ public: * * @param[in] pkgId - id of the package to update * @param[in] pkgContents - a list of all applications in the package + * @param[in] zoneId - ID of zone which requested application uninstall */ - static void updatePackageRules(const std::string &pkgId, const std::vector &pkgContents); + static void updatePackageRules(const std::string &pkgId, + const std::vector &pkgContents, const std::string &zoneId); private: /**