From: Marcin Niesluchowski Date: Thu, 24 Apr 2014 13:54:54 +0000 (+0200) Subject: Adapt tests to new exec labelling design. X-Git-Tag: security-manager_5.5_testing~251 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf47add361fe182b182cd6f2277276ac7a5482d3;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git Adapt tests to new exec labelling design. 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 --- diff --git a/tests/libprivilege-control-tests/libprivilege-control_test_common.cpp b/tests/libprivilege-control-tests/libprivilege-control_test_common.cpp index bd00754..b9789d1 100644 --- a/tests/libprivilege-control-tests/libprivilege-control_test_common.cpp +++ b/tests/libprivilege-control-tests/libprivilege-control_test_common.cpp @@ -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");