Skip to content

Commit

Permalink
fix(libsinsp_e2e): filter using tid
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo authored and poiana committed Oct 8, 2024
1 parent e15d956 commit 3712714
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/libsinsp_e2e/sys_call_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1357,13 +1357,15 @@ TEST_F(sys_call_test, getsetresuid_and_gid) {
ret = system("groupdel testsetresgid");
usleep(200);

const pid_t self = getpid();

//
// FILTER
//
event_filter_t filter = [&](sinsp_evt* evt) {
auto type = evt->get_type();
auto tinfo = evt->get_thread_info(true);
return tinfo->m_comm != "sudo" &&
return tinfo->m_comm != "sudo" && tinfo->m_pid == self &&
(type == PPME_USER_ADDED_E || type == PPME_USER_ADDED_X ||
type == PPME_GROUP_ADDED_E || type == PPME_GROUP_ADDED_X ||
type == PPME_SYSCALL_GETRESUID_E || type == PPME_SYSCALL_GETRESUID_X ||
Expand Down

0 comments on commit 3712714

Please sign in to comment.