Fix SMACK issue 02/292602/2
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 10 May 2023 06:11:32 +0000 (06:11 +0000)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 10 May 2023 06:32:10 +0000 (06:32 +0000)
If calling security_manager_prepare_app2() is failed, the process cannot
access the executable file. In that time, the SMACK denied issue can be occurred.

Change-Id: I009a19d471463f6948a2fbb193169da9a0d7ef89
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/launchpad/src/launchpad_lib.c

index a96f4684f5d575f1ea9dbec29f2541bb718c2041..716bec6f7c711ba7976f0ea02ee1b66fae14a5b7 100644 (file)
@@ -181,18 +181,13 @@ static int __default_launch_cb(bundle *kb, const char *appid,
                const char *app_path, const char *root_path,
                const char *pkgid, const char *pkg_type, int loader_type, bool global)
 {
-       char err_str[MAX_LOCAL_BUFSZ] = { 0, };
        int r;
 
        r = __prepare_exec(appid, app_path, pkg_type, loader_type, pkgid,
                        root_path, global, kb);
        if (r < 0) {
-               _E("__candidate_process_prepare_exec() failed");
-               if (access(app_path, F_OK | R_OK)) {
-                       SECURE_LOGE("access() failed for file: \"%s\", " \
-                               "error: %d (%s)", app_path, errno,
-                               strerror_r(errno, err_str, sizeof(err_str)));
-               }
+               _E("__candidate_process_prepare_exec() failed. %s : %s",
+                               appid, app_path);
                exit(-1);
        }