Adapt tests to new exec labelling design. 17/20017/2
authorMarcin Niesluchowski <m.niesluchow@samsung.com>
Thu, 24 Apr 2014 13:54:54 +0000 (15:54 +0200)
committerMarcin Niesluchowski <m.niesluchow@samsung.com>
Wed, 7 May 2014 10:25:06 +0000 (12:25 +0200)
Remove smack exec label checks for links.
See:
-> 'Adapt to tizenorg: Change implementation of exec labels for links to binaries'

Verification:
-> libprivilege-control-test --output=text \
   --regexp=privilege_control02_app_label_dir
   (test should pass)

Change-Id: Ided8c081c8fbd3b672f34a325373ccbbba653ef8

tests/libprivilege-control-tests/libprivilege-control_test_common.cpp

index bd00754..b9789d1 100644 (file)
@@ -265,18 +265,6 @@ int nftw_check_labels_app_dir(const char *fpath, const struct stat *sb,
         RUNNER_ASSERT_MSG_BT(labelPtr.get() != NULL, "EXEC label on " << fpath << " is not set");
         result = strcmp(USER_APP_ID, labelPtr.get());
         RUNNER_ASSERT_MSG_BT(result == 0, "EXEC label on executable file " << fpath << " is incorrect");
-    } else if (S_ISLNK(sb->st_mode)) {
-        struct stat buf;
-        char *target = realpath(fpath, NULL);
-        RUNNER_ASSERT_MSG_BT(0 == stat(target, &buf),"Stat failed for " << fpath);
-        free(target);
-        if (buf.st_mode != (buf.st_mode | S_IXUSR | S_IFREG)) {
-            RUNNER_ASSERT_MSG_BT(labelPtr.get() == NULL, "EXEC label on " << fpath << " is set");
-        } else {
-            RUNNER_ASSERT_MSG_BT(labelPtr.get() != NULL, "EXEC label on " << fpath << " is not set");
-            result = strcmp(USER_APP_ID, labelPtr.get());
-            RUNNER_ASSERT_MSG_BT(result == 0, "EXEC label on link to executable file " << fpath << " is incorrect");
-        }
     } else
         RUNNER_ASSERT_MSG_BT(labelPtr.get() == NULL, "EXEC label on " << fpath << " is set");