Fix only partial rollback of Smack rules 44/240344/2
authorMateusz Cegielka <m.cegielka@samsung.com>
Fri, 24 Jul 2020 15:13:25 +0000 (17:13 +0200)
committerMateusz Cegielka <m.cegielka@samsung.com>
Tue, 11 Aug 2020 11:49:59 +0000 (13:49 +0200)
commitd268044f6b941e7f9526ed765a6503708bf67e3a
tree08e01dfec1f090cca2c5650e9e9f77e604aebf65
parent3473c4207ef2f437804e7eb40b8ffd2163b84846
Fix only partial rollback of Smack rules

Some tests temporarily add new Smack rules in order to test unprivileged
access to system services. After the test, they are cleared with
smack_revoke_subject. However, this only removes rules where the test
application is the subject.

I have replaced calls where this is an issue with a smack_accesses_clear
call, which removes all rules loaded with a given handle. Since affected
tests do not modify Smack rules in any other way and only use test
labels for fake apps, no rules removed by the old call and not by the
new call can exist.

Change-Id: I841d6b7ad05549d8837645e3d9176f4db7029908
src/ckm/privileged/access_provider2.cpp
src/ckm/privileged/access_provider2.h
src/common/smack_access.cpp
src/common/smack_access.h