Skip to content

Commit d38e3a3

Browse files
Merge pull request #2990 from craigcomstock/CFE-3429/master
Use current process ID to investigate proc filesystem to workaround in-container non-root owned symlinks
2 parents 535a022 + a92005f commit d38e3a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

inventory/linux.cf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ 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",
@@ -48,10 +48,10 @@ bundle common inventory_linux
4848
# e.g., nfs.example.com:/vol/homedir/user1 /home/user1 ...
4949
# ^^^^^^^^^^^^^^^
5050
grep( ".* nfs .*",
51-
readstringlist("/proc/mounts", "", "\n", inf, inf)
51+
readstringlist("/proc/$(this.promiser_pid)/mounts", "", "\n", inf, inf)
5252
)
5353
),
54-
if => fileexists( "/proc/mounts" );
54+
if => fileexists( "/proc/$(this.promiser_pid)/mounts" );
5555

5656

5757
"nfs_server[$(nfs_servers)]"

0 commit comments

Comments
 (0)