[Issue#] N/A
[Bug/Feature] privilege_control05_set_app_privilege tests fails
[Cause] perm_end fails after perm_app_set_privilege call
[Solution] Remove transaction around perm_app_set_privilege calls
[Verification] Build, install, run tests
Change-Id: Ida1b94eff78180a217f9410f1d168d75a43179e3
result = test_have_all_accesses(rules);
RUNNER_ASSERT_MSG(result == 1, "Permissions not added.");
result = test_have_all_accesses(rules);
RUNNER_ASSERT_MSG(result == 1, "Permissions not added.");
result = perm_app_set_privilege(app_id, type, app_path);
RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Line: " << line_no <<
" Error in perm_app_set_privilege. Error: " << result);
result = perm_app_set_privilege(app_id, type, app_path);
RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Line: " << line_no <<
" Error in perm_app_set_privilege. Error: " << result);
// Check if SMACK label really set
char *label;
result = smack_new_label_from_self(&label);
// Check if SMACK label really set
char *label;
result = smack_new_label_from_self(&label);
RUNNER_ASSERT_MSG(result == -1, "Line: " << line_no <<
" Permissions shouldn't be added. Result: " << result);
RUNNER_ASSERT_MSG(result == -1, "Line: " << line_no <<
" Permissions shouldn't be added. Result: " << result);
result = perm_app_set_privilege(app_id, type, app_path);
RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Line: " << line_no <<
" Error in perm_app_set_privilege. Error: " << result);
result = perm_app_set_privilege(app_id, type, app_path);
RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Line: " << line_no <<
" Error in perm_app_set_privilege. Error: " << result);
//Even though app privileges are set, no smack label should be extracted.
char* label = NULL;
result = smack_new_label_from_self(&label);
//Even though app privileges are set, no smack label should be extracted.
char* label = NULL;
result = smack_new_label_from_self(&label);
smack_lsetlabel(APP_SET_PRIV_PATH_REAL, APP_ID, SMACK_LABEL_EXEC);
smack_lsetlabel(APP_SET_PRIV_PATH, APP_ID "_symlink", SMACK_LABEL_EXEC);
smack_lsetlabel(APP_SET_PRIV_PATH_REAL, APP_ID, SMACK_LABEL_EXEC);
smack_lsetlabel(APP_SET_PRIV_PATH, APP_ID "_symlink", SMACK_LABEL_EXEC);
//Set app privileges
result = perm_app_set_privilege(APP_ID, NULL, APP_SET_PRIV_PATH);
RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS,
"Error in perm_app_set_privilege. Error: " << result);
//Set app privileges
result = perm_app_set_privilege(APP_ID, NULL, APP_SET_PRIV_PATH);
RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS,
"Error in perm_app_set_privilege. Error: " << result);
//Even though app privileges are set, no smack label should be extracted.
char* label = NULL;
result = smack_new_label_from_self(&label);
//Even though app privileges are set, no smack label should be extracted.
char* label = NULL;
result = smack_new_label_from_self(&label);