static const std::vector<std::string> SM_ALLOWED_GROUPS = {"db_browser", "db_alarm"};
-static const char *const SM_PRIVATE_PATH = "/etc/smack/test_DIR/app_dir";
-static const char *const SM_PUBLIC_PATH = "/etc/smack/test_DIR/app_dir_public";
-static const char *const SM_PUBLIC_RO_PATH = "/etc/smack/test_DIR/app_dir_public_ro";
-static const char *const SM_DENIED_PATH = "/etc/smack/test_DIR/non_app_dir";
+static const char *const SM_PRIVATE_PATH = "/usr/apps/test_DIR/app_dir";
+static const char *const SM_PUBLIC_RO_PATH = "/usr/apps/test_DIR/app_dir_public_ro";
+static const char *const SM_DENIED_PATH = "/usr/apps/test_DIR/non_app_dir";
static const char *const SM_PRIVATE_PATH_FOR_USER = "/home/" APP_USER "/test_DIR";
static const char *const ANY_USER_REPRESENTATION = "anyuser";/*this may be actually any string*/
return nftw_check_sm_labels_app_dir(fpath, sb, USER_APP_ID, false, true);
}
-static int nftw_check_sm_labels_app_public_dir(const char *fpath, const struct stat *sb,
- int /*typeflag*/, struct FTW* /*ftwbuf*/)
-{
-
- return nftw_check_sm_labels_app_dir(fpath, sb, "User", true, false);
-}
-
static int nftw_check_sm_labels_app_floor_dir(const char *fpath, const struct stat *sb,
int /*typeflag*/, struct FTW* /*ftwbuf*/)
{
result = nftw(SM_PRIVATE_PATH, &nftw_remove_labels, FTW_MAX_FDS, FTW_PHYS);
RUNNER_ASSERT_MSG(result == 0, "Unable to clean Smack labels in " << SM_PRIVATE_PATH);
- result = nftw(SM_PUBLIC_PATH, &nftw_remove_labels, FTW_MAX_FDS, FTW_PHYS);
- RUNNER_ASSERT_MSG(result == 0, "Unable to clean Smack labels in " << SM_PUBLIC_PATH);
-
result = nftw(SM_PUBLIC_RO_PATH, &nftw_remove_labels, FTW_MAX_FDS, FTW_PHYS);
RUNNER_ASSERT_MSG(result == 0, "Unable to clean Smack labels in " << SM_PUBLIC_RO_PATH);
result = nftw(SM_PRIVATE_PATH, &nftw_check_sm_labels_app_private_dir, FTW_MAX_FDS, FTW_PHYS);
RUNNER_ASSERT_MSG(result == 0, "Unable to check Smack labels for " << SM_PRIVATE_PATH);
- result = nftw(SM_PUBLIC_PATH, &nftw_check_sm_labels_app_public_dir, FTW_MAX_FDS, FTW_PHYS);
- RUNNER_ASSERT_MSG(result == 0, "Unable to check Smack labels for " << SM_PUBLIC_PATH);
-
result = nftw(SM_PUBLIC_RO_PATH, &nftw_check_sm_labels_app_floor_dir, FTW_MAX_FDS, FTW_PHYS);
RUNNER_ASSERT_MSG(result == 0, "Unable to check Smack labels for " << SM_PUBLIC_RO_PATH);
RUNNER_ASSERT_MSG((lib_retcode)result == SECURITY_MANAGER_SUCCESS,
"setting allowed path failed. Result: " << result);
- result = security_manager_app_inst_req_add_path(request.get(), SM_PUBLIC_PATH,
- SECURITY_MANAGER_PATH_PUBLIC);
- RUNNER_ASSERT_MSG((lib_retcode)result == SECURITY_MANAGER_SUCCESS,
- "setting allowed path failed. Result: " << result);
-
result = security_manager_app_inst_req_add_path(request.get(), SM_PUBLIC_RO_PATH,
SECURITY_MANAGER_PATH_PUBLIC_RO);
RUNNER_ASSERT_MSG((lib_retcode)result == SECURITY_MANAGER_SUCCESS,