Skip to content

Commit

Permalink
Consider hostname localhost not as a container
Browse files Browse the repository at this point in the history
  • Loading branch information
Atoptool committed Aug 29, 2023
1 parent be0d24d commit b332ffc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utsnames.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ getutsname(struct tstat *curtask)
// check if the hostname is the same as the hostname of
// systemd (PID 1), because some systemd-related processes have
// their own UTS namespace with the same hostname
// also the hostname 'localhost' might be used by various daemons
// and will be skipped as well
//
if ( strcmp(tmphost, basehost) == 0)
if ( strcmp(tmphost, basehost) == 0 || strcmp(tmphost, "localhost") == 0)
goto drop_and_return;

// this process really seems to be container/pod related
Expand Down

0 comments on commit b332ffc

Please sign in to comment.