From: Jan Olszak Date: Fri, 20 Sep 2013 09:40:10 +0000 (+0200) Subject: Modified boot script, added deleting volatile rules. X-Git-Tag: accepted/tizen/generic/20140307.163253~1^2~22^2~35 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fsecurity%2Flibprivilege-control.git;a=commitdiff_plain;h=a042c79d9d449388268224b5733c0f37af939831 Modified boot script, added deleting volatile rules. [Issue#] SSDWSSP-183 [Bug/Feature] Volatile rules were not deleted. [Cause] N/A [Solution] Deleteing volatile rules from the database. [Verification] Build, install, run tests. Change-Id: Ia7b2667177f5d95b838d8c891d02ecddfaa4a554 --- diff --git a/db/load-rules-db.sql b/db/load-rules-db.sql index 27724ba..79fe6fe 100644 --- a/db/load-rules-db.sql +++ b/db/load-rules-db.sql @@ -3,9 +3,19 @@ PRAGMA journal_mode = DELETE; -.output "/opt/etc/smack/boot-rules.smack" +BEGIN TRANSACTION; + +INSERT INTO all_smack_binary_rules +SELECT subject, object, access, is_volatile +FROM all_smack_binary_rules_view +WHERE NOT EXISTS (SELECT * FROM all_smack_binary_rules); +-- Delete volatile rules +DELETE FROM app_permission WHERE is_volatile=1; + + +.output "/opt/etc/smack/boot-rules.smack" SELECT subject, object, access_to_str(access) FROM all_smack_binary_rules WHERE all_smack_binary_rules.is_volatile = 0; - +COMMIT TRANSACTION; \ No newline at end of file diff --git a/db/rules-db-data.sql b/db/rules-db-data.sql index 896fafc..c53146e 100644 --- a/db/rules-db-data.sql +++ b/db/rules-db-data.sql @@ -114,4 +114,6 @@ INSERT INTO all_smack_binary_rules SELECT subject, object, access, is_volatile FROM all_smack_binary_rules_view; -COMMIT TRANSACTION; \ No newline at end of file +COMMIT TRANSACTION; + +VACUUM; \ No newline at end of file