Temporary workaround for complimentary groups not working on non-SMACK system.
authorRafal Krypa <r.krypa@samsung.com>
Thu, 18 Apr 2013 14:18:05 +0000 (16:18 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 22 Apr 2013 09:00:26 +0000 (11:00 +0200)
[Issue#]       N/A
[Bug]          set_app_privilege() fails when SMACK is not available.
[Cause]        Complimentary groups setting depend on getting app_id from process' SMACK label.
[Solution]     Temporarily turn this off for non-SMACK systems.
[Verification] Build, install on non-SMACK system, reboot target, run some apps.

Change-Id: I9733c1d28ab810de6b40c56a2a79747978ab2911

src/privilege-control.c

index eed750e..0efdec5 100644 (file)
@@ -338,7 +338,10 @@ static int set_dac(const char* pkg_name)
                }
 
 #ifdef SMACK_ENABLED
-               {
+               /* FIXME: this should be reworked to not depend on SMACK
+                * proper solution is not trivial (no app_id is passed to set_app_privilege())
+                */
+               if (have_smack()) {
                        gid_t *glist_new;
                        int i, cnt;