cleaning_smack_database_files();
//test what happens when the label is not correct SMACK label
- result = smack_accesses_new(&rules);
- RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in smack_accesses_new.");
-
result = add_shared_dir_readers(TEST_OBJ,app_labels_wrong);
RUNNER_ASSERT_MSG(result == PC_ERR_INVALID_PARAM, "add_shared_dir_readers should fail here");
result = smack_have_access(app_labels_wrong[0],TEST_OBJ,"rx");
RUNNER_ASSERT_MSG(result != 1, "add_shared_dir_readers should not grant permission here");
- smack_accesses_free(rules);
-
//ok, now the correct list of apps
result = smack_accesses_new(&rules);
RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in smack_accesses_new.");
result = perm_app_revoke_permissions(app_labels[i]);
RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in perm_app_revoke_permissions.");
result = perm_app_uninstall(app_labels[i]);
- RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in perm_app_install.");
+ RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in perm_app_uninstall.");
result = perm_app_install(app_labels[i]);
RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in perm_app_install.");
// correct rules
result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE, (const char*[]) { "malformed malformed maaaaaalformed", NULL }, NULL, 0);
RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
- osp_blahblah_check(__LINE__, { "malformed malformed r--a-l ------" });
+ osp_blahblah_check(__LINE__, { "malformed malformed r--a-l" });
remove_smack_files();
result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE, (const char*[]) { "subject object foo", NULL }, NULL, 0);
RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
- osp_blahblah_check(__LINE__, { "subject object ------ ------" });
+ osp_blahblah_check(__LINE__, { "subject object ------" });
remove_smack_files();
result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE, (const char*[]) {
NULL
}, NULL, 0);
RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
- osp_blahblah_check(__LINE__, { "subject object rwxatl ------", "subject2 object2 rwxatl ------"});
+ osp_blahblah_check(__LINE__, { "subject object rwxatl", "subject2 object2 rwxatl"});
remove_smack_files();
result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE, (const char*[]) {
NULL
}, NULL, 0);
RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
- osp_blahblah_check(__LINE__, { "Sub::jE,ct object rwxa-l ------"});
+ osp_blahblah_check(__LINE__, { "Sub::jE,ct object rwxa-l"});
remove_smack_files();
// TODO For now identical/complementary rules are not merged.
NULL
}, NULL, 0);
RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
- osp_blahblah_check(__LINE__, { "subject object rwxatl ------", "subject object rwxatl ------"});
+ osp_blahblah_check(__LINE__, { "subject object rwxatl", "subject object rwxatl"});
remove_smack_files();
// empty group ids
result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE, (const char*[]) {"a a a",NULL},(const gid_t[]) {0,1,2},0);
RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
- osp_blahblah_check(__LINE__, { "a a ---a-- ------"});
+ osp_blahblah_check(__LINE__, { "a a ---a--"});
result = file_exists(OSP_BLAHBLAH_DAC);
RUNNER_ASSERT(result == -1);
remove_smack_files();
result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE, (const char*[]) {"a a a",NULL},(const gid_t[]) {0,1,2},3);
printf("%d \n", result);
RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
- osp_blahblah_check(__LINE__, { "a a ---a-- ------"});
+ osp_blahblah_check(__LINE__, { "a a ---a--"});
osp_blahblah_dac_check(__LINE__, {0,1,2});
remove_smack_files();
result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE, (const char*[]) {"a a a",NULL},(const gid_t[]) {0,1,2},1);
RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
- osp_blahblah_check(__LINE__, { "a a ---a-- ------"});
+ osp_blahblah_check(__LINE__, { "a a ---a--"});
osp_blahblah_dac_check(__LINE__, {0});
remove_smack_files();
result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE, (const char*[]) {"a a a",NULL},(const gid_t[]) {1,1,1},3);
RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
- osp_blahblah_check(__LINE__, { "a a ---a-- ------"});
+ osp_blahblah_check(__LINE__, { "a a ---a--"});
osp_blahblah_dac_check(__LINE__, {1,1,1});
remove_smack_files();
}