Skip to content

CFE-3429: Use current process ID to investigate proc filesystem to workaround in-container non-root owned symlinks (3.24) #5780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: 3.24.x
Choose a base branch
from

Conversation

craigcomstock
Copy link
Contributor

  • Use current process ID to investigate proc filesystem to workaround in-container non-root owned symlinks
  • Added error message when netstat file is not found during UNIX interface discovery.
  • Move GetRelocatedProcdirRoot() from libntech and add GetProcdirPid()
  • Added env var pid override in proc-net acceptance test To align with change to reading /proc//...
  • bump libntech to master

Jakob Riepler and others added 5 commits April 23, 2025 14:53
…n-container non-root owned symlinks

Note man 5 proc mentions how the symlinks work:

       /proc/self
              When a process accesses this magic symbolic link, it resolves to the process's own /proc/pid directory.

and also:

              With  the  advent  of network namespaces, various information relating to the network stack is virtualized (see net‐
              work_namespaces(7)).  Thus, since Linux 2.6.25, /proc/net is a symbolic link to the directory /proc/self/net,  which
              contains  the  same files and directories as listed below.  However, these files and directories now expose informa‐
              tion for the network namespace of which the process is a member.

So this change seems like a good workaround for linux systems and CFEngine's requirement that symlinks be owned by the running pid.

Ticket: CFE-3429
Changelog: title
Signed-off-by: Craig Comstock <[email protected]>
(cherry picked from commit 031972b)
…ace discovery.

Ticket: CFE-3429
Changelog: none
(cherry picked from commit 8441e84)
These have checks for environment variables to override to support testing.

Ticket: CFE-3429
Changelog: none
(cherry picked from commit 628055f)
To align with change to reading /proc/<pid>/...

Ticket: CFE-3429
Changelog: none
(cherry picked from commit 8470d79)
@cf-bottom
Copy link

Thanks for submitting a pull request! Maybe @larsewi can review this?

Copy link

Marking this PR as stale due to inactivity; it will be closed in 7 days.

@github-actions github-actions bot added the stale Pull requests with no recent activity label May 31, 2025
Copy link

github-actions bot commented Jun 8, 2025

Closing PR due to inactivity. Feel free to open a new PR if necessary.

@github-actions github-actions bot closed this Jun 8, 2025
@nickanderson nickanderson removed after-release stale Pull requests with no recent activity labels Jul 29, 2025
@nickanderson nickanderson self-requested a review July 29, 2025 18:21
@nickanderson nickanderson reopened this Jul 29, 2025
@nickanderson
Copy link
Member

@craigcomstock , looks like this one auto-closed, re-opening.

Copy link
Member

@nickanderson nickanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been using 3.27 nightly for some container stuff. Would be nice to have this back in 3.24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants