diff options
author | Hyotaek Shim <hyotaek.shim@samsung.com> | 2017-06-01 21:04:46 +0900 |
---|---|---|
committer | Hyotaek Shim <hyotaek.shim@samsung.com> | 2017-06-01 21:04:46 +0900 |
commit | 359b85307eac41c867ac6cafaaec1154c9396f47 (patch) | |
tree | bcfffe9971d3c3ce7a2a5c8dd82147a0bb0ff935 | |
parent | a3ded0117f8e5e99367511db01b410f890df1366 (diff) | |
download | system-plugin-359b85307eac41c867ac6cafaaec1154c9396f47.tar.gz system-plugin-359b85307eac41c867ac6cafaaec1154c9396f47.tar.bz2 system-plugin-359b85307eac41c867ac6cafaaec1154c9396f47.zip |
Set the smack execute label to User right before exec(user session systemd)submit/tizen_3.0/20170605.055615accepted/tizen/3.0/wearable/20170608.070812accepted/tizen/3.0/tv/20170608.070809accepted/tizen/3.0/mobile/20170608.070807accepted/tizen/3.0/ivi/20170608.070814accepted/tizen/3.0/common/20170608.115309
Change-Id: I27169864b922e528a52db25ef24ecf5121643a95
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
-rw-r--r-- | src/systemd-user-helper/systemd-user-helper.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/systemd-user-helper/systemd-user-helper.c b/src/systemd-user-helper/systemd-user-helper.c index 5fb1057..5b634a5 100644 --- a/src/systemd-user-helper/systemd-user-helper.c +++ b/src/systemd-user-helper/systemd-user-helper.c @@ -353,6 +353,12 @@ 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); @@ -393,12 +399,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); |