Set the smack execute label to "User" right before exec(user session systemd) 15/131115/2 accepted/tizen/unified/20170602.154420 submit/tizen/20170601.120111
authorHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 25 May 2017 10:59:03 +0000 (19:59 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 25 May 2017 11:05:58 +0000 (20:05 +0900)
Change-Id: I78412471a8970b78ae10ce341ad2ad491c8b64b2
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
src/systemd-user-helper/systemd-user-helper.c

index f2b9620235de92a56d10761c9d1ce27db893e2bb..882f59650f374440cc6c37cc074c91dd6f765798 100644 (file)
@@ -362,6 +362,13 @@ int run_child(int argc, const char *argv[], char* user_id)
                fprintf(stderr, "failed to fork");
                r = -errno;
        } else if (pid == 0) {
+               r = change_smack_for_user_session();
+               if(r != 0)
+               {
+                       fprintf(stderr, "failed to change smack\n");
+                       return r;
+               }
+
                for (i = 0; i < _NSIG; ++i)
                        signal(i, SIG_DFL);
 
@@ -402,12 +409,6 @@ int main(int argc, char *argv[])
                fprintf(stderr, "mount user_ext failed\n");
                return r;
        }
-       r = change_smack_for_user_session();
-       if(r != 0)
-       {
-               fprintf(stderr, "failed to change smack\n");
-               return r;
-       }
 
        /* pre-processing */
        r = normal_user_preprocess(username);