Skip to content

Commit 7218784

Browse files
Jakob Rieplercraigcomstock
authored andcommitted
Use current process ID to investigate proc filesystem to workaround in-container non-root owned symlinks
Ticket: CFE-3429 Changelog: title Signed-off-by: Craig Comstock <[email protected]> (cherry picked from commit a92005f)
1 parent fd519ed commit 7218784

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

inventory/linux.cf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ bundle common inventory_linux
3232
"proc_1_process" string => filestat($(proc_1_cmdline), "linktarget");
3333

3434
any::
35-
"proc_routes" data => data_readstringarrayidx("/proc/net/route",
35+
"proc_routes" data => data_readstringarrayidx("/proc/$(this.promiser_pid)/net/route",
3636
"#[^\n]*","\s+",40,4k),
37-
if => fileexists("/proc/net/route");
37+
if => fileexists("/proc/$(this.promiser_pid)/net/route");
3838
"routeidx" slist => getindices("proc_routes");
3939
"dgw_ipv4_iface" string => "$(proc_routes[$(routeidx)][0])",
4040
comment => "Name of the interface where default gateway is routed",
4141
if => strcmp("$(proc_routes[$(routeidx)][1])", "00000000");
4242

4343
linux::
44-
"mounts" string => "/proc/mounts";
44+
"mounts" string => "/proc/$(this.promiser_pid)/mounts";
4545

4646
"nfs_mounts"
4747
slist => grep( ".* nfs .*",

0 commit comments

Comments
 (0)