CFE-3429: Use current process ID to investigate proc filesystem to workaround in-container non-root owned symlinks (3.24)#5780
Conversation
|
Thanks for submitting a pull request! Maybe @larsewi can review this? |
|
Marking this PR as stale due to inactivity; it will be closed in 7 days. |
|
Closing PR due to inactivity. Feel free to open a new PR if necessary. |
|
@craigcomstock , looks like this one auto-closed, re-opening. |
nickanderson
left a comment
There was a problem hiding this comment.
I have been using 3.27 nightly for some container stuff. Would be nice to have this back in 3.24.
|
Marking this PR as stale due to inactivity; it will be closed in 7 days. |
|
Closing PR due to inactivity. Feel free to open a new PR if necessary. |
…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 <craig.comstock@northern.tech>
(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)
5811870 to
9faa281
Compare
9faa281 to
e198dc2
Compare
|
the libntech bump in this PR was stale and caused macos unit test failures, so rebased libntech to current 3.24.x version. |
The function 'strchrnul' has been marked as being introduced in macOS
15.4, although it seems to have been working for as long as we have been
testing on macOS. Since warnings are treated as errors, the build will
fail. Hence, the simplest way to silence the warning is, it to specify
the deployment target to be a minimum of macOS 15.4.
```
logging.c:651:28: error: 'strchrnul' is only available on macOS 15.4 or newer [-Werror,-Wunguarded-availability-new]
651 | char *next_token = strchrnul(token, ',');
CC queue.lo
| ^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_string.h:198:9: note: 'strchrnul' has been marked as being introduced in macOS 15.4 here, but the deployment target is macOS 15.0.0
198 | strchrnul(const char *__s, int __c);
CC rb-tree.lo
| ^
logging.c:651:28: note: enclose 'strchrnul' in a __builtin_available check to silence this warning
651 | char *next_token = strchrnul(token, ',');
| ^~~~~~~~~
1 error generated.
```
It has been done similarly here: NorthernTechHQ/libntech#255
Signed-off-by: Victor Moene <victor.moene@northern.tech>
(cherry picked from commit f1c9a91)
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech> (cherry picked from commit 1486c24) Conflicts: .github/workflows/macos_unit_tests.yml Use of librsync (cfengine#5629) was not cherry picked to 3.24.x
Check for Homebrew if we're on Darwin and use brew's --prefix. Ticket: CFE-4385 (cherry picked from commit 7e88d4b) Conflicts: .github/workflows/macos_unit_tests.yml configure.ac using librsync (cfengine#5629) was not cherry-picked to 3.24.x so adjustments were needed.
The argument checking has been present for a while. Interestingly 3 days ago there was a commit to silence many of these warnings: curl/curl@92f215f Ticket: CFE-3429 Changelog: none
|
the curl_easy_setopt() problem doesn't seem to be present in master so this should be sufficient here. |
No description provided.