#include <memory>
#include <functional>
#include <fstream>
+#include <set>
#include <string.h>
#include <errno.h>
RUNNER_ASSERT_MSG_BT(result == -1,
" Permissions shouldn't be added. Result: " << result);
+ std::set<unsigned> groups_before;
+ read_user_gids(groups_before, APP_UID);
+
result = perm_app_set_privilege(app_id, type, app_path);
RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS,
" Error in perm_app_set_privilege. Error: " << result);
RUNNER_ASSERT_MSG_BT(label == NULL,
" new_label_from_self shouldn't allocate memory for label.");
- check_groups(dac_file);
+ check_groups(groups_before, dac_file);
}
/**
perm_app_uninstall(APP_ID);
DB_END
+ std::set<unsigned> groups_before;
+ read_user_gids(groups_before, APP_UID);
+
//Set app privileges
result = perm_app_set_privilege(APP_ID, NULL, APP_SET_PRIV_PATH);
RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS,
result = strcmp(getenv("USER"), APP_USER_NAME);
RUNNER_ASSERT_MSG_BT(result == 0, "Wrong user USER NAME. Result: " << result);
- check_groups(LIBPRIVILEGE_TEST_DAC_FILE);
+ check_groups(groups_before, NULL);
}
/**