From: Hyotaek Shim Date: Thu, 25 May 2017 10:59:03 +0000 (+0900) Subject: Set the smack execute label to "User" right before exec(user session systemd) X-Git-Tag: submit/tizen/20170601.120111^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd515c592ff1b91fa42dbd39e2b43c6c31da8526;p=platform%2Fcore%2Fsystem%2Fsession-utils.git Set the smack execute label to "User" right before exec(user session systemd) Change-Id: I78412471a8970b78ae10ce341ad2ad491c8b64b2 Signed-off-by: Hyotaek Shim --- diff --git a/src/systemd-user-helper/systemd-user-helper.c b/src/systemd-user-helper/systemd-user-helper.c index f2b9620..882f596 100644 --- a/src/systemd-user-helper/systemd-user-helper.c +++ b/src/systemd-user-helper/systemd-user-helper.c @@ -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);