From 6d8a974977af77c467d94797c2838948028c868a Mon Sep 17 00:00:00 2001 From: Rafal Krypa Date: Fri, 6 Mar 2015 18:52:20 +0100 Subject: [PATCH] Drop workaround for all applications labeled with "User" label Because every app used to have the same label, special fixes were needed for app uninstallation not to break Smack policy for "User" label. Now with final application labels this is no longer needed. Dropping the workaround. Change-Id: I83d3df1499f8c0eb21d2c954c2fcba3283938a5e Signed-off-by: Rafal Krypa --- src/common/smack-rules.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/common/smack-rules.cpp b/src/common/smack-rules.cpp index 221cf4d..3629e0f 100644 --- a/src/common/smack-rules.cpp +++ b/src/common/smack-rules.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -253,27 +252,6 @@ void SmackRules::updatePackageRules(const std::string &pkgId, const std::vector< smackRules.saveToFile(pkgPath); } -/* FIXME: Remove this function if real pkgId instead of "User" label will be used - * in generateAppLabel(). */ -void SmackRules::addMissingRulesFix() -{ - struct dirent *ent; - - std::string path(tzplatform_mkpath(TZ_SYS_SMACK, "accesses.d")); - std::unique_ptr> dir(opendir(path.c_str()), closedir); - if (!dir) - ThrowMsg(SmackException::FileError, "opendir"); - - while ((ent = readdir(dir.get()))) { - SmackRules rules; - if (ent->d_type == DT_REG) { - rules.loadFromFile(tzplatform_mkpath3(TZ_SYS_SMACK, "accesses.d/", ent->d_name)); - // Do not check error here. If this fails we can't do anything anyway. - } - rules.apply(); - } -} - void SmackRules::uninstallPackageRules(const std::string &pkgId) { uninstallRules(getPackageRulesFilePath(pkgId)); @@ -284,9 +262,6 @@ void SmackRules::uninstallApplicationRules(const std::string &appId, { uninstallRules(getApplicationRulesFilePath(appId)); updatePackageRules(pkgId, pkgContents); - - // FIXME: Reloading all rules: - SmackRules::addMissingRulesFix(); } void SmackRules::uninstallRules(const std::string &path) -- 2.7.4