Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding another slash for path
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Schendel <amitschendel@gmail.com>
amitschendel committed Oct 13, 2024
1 parent 46483d3 commit ebbfd56
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion process/process.go
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ func parseMappings(mapsFile io.Reader, pid libpf.PID) ([]Mapping, error) {
continue
}
} else {
path = "/proc/" + strconv.Itoa(int(pid)) + "/root" + trimMappingPath(path)
path = "/proc/" + strconv.Itoa(int(pid)) + "/root/" + trimMappingPath(path)
path = strings.Clone(path)
}

14 changes: 7 additions & 7 deletions process/process_test.go
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ func TestParseMappings(t *testing.T) {
Inode: 1068432,
Length: 0x2c000,
FileOffset: 0,
Path: "/proc/1/root/tmp/usr_bin_seahorse",
Path: "/proc/1/root//tmp/usr_bin_seahorse",
},
{
Vaddr: 0x55fe8273c000,
@@ -46,7 +46,7 @@ func TestParseMappings(t *testing.T) {
Inode: 1068432,
Length: 0x82000,
FileOffset: 0x2c000,
Path: "/proc/1/root/tmp/usr_bin_seahorse",
Path: "/proc/1/root//tmp/usr_bin_seahorse",
},
{
Vaddr: 0x55fe827be000,
@@ -55,7 +55,7 @@ func TestParseMappings(t *testing.T) {
Inode: 1068432,
Length: 0x78000,
FileOffset: 0xae000,
Path: "/proc/1/root/tmp/usr_bin_seahorse",
Path: "/proc/1/root//tmp/usr_bin_seahorse",
},
{
Vaddr: 0x55fe82836000,
@@ -64,7 +64,7 @@ func TestParseMappings(t *testing.T) {
Inode: 1068432,
Length: 0x7000,
FileOffset: 0x125000,
Path: "/proc/1/root/tmp/usr_bin_seahorse",
Path: "/proc/1/root//tmp/usr_bin_seahorse",
},
{
Vaddr: 0x55fe8283d000,
@@ -73,7 +73,7 @@ func TestParseMappings(t *testing.T) {
Inode: 1068432,
Length: 0x1000,
FileOffset: 0x12c000,
Path: "/proc/1/root/tmp/usr_bin_seahorse",
Path: "/proc/1/root//tmp/usr_bin_seahorse",
},
{
Vaddr: 0x7f63c8c3e000,
@@ -82,7 +82,7 @@ func TestParseMappings(t *testing.T) {
Inode: 1048922,
Length: 0x1A2000,
FileOffset: 544768,
Path: "/proc/1/root/tmp/usr_lib_x86_64-linux-gnu_libcrypto.so.1.1",
Path: "/proc/1/root//tmp/usr_lib_x86_64-linux-gnu_libcrypto.so.1.1",
},
{
Vaddr: 0x7f63c8ebf000,
@@ -91,7 +91,7 @@ func TestParseMappings(t *testing.T) {
Inode: 1075944,
Length: 0x130000,
FileOffset: 114688,
Path: "/proc/1/root/tmp/usr_lib_x86_64-linux-gnu_libopensc.so.6.0.0",
Path: "/proc/1/root//tmp/usr_lib_x86_64-linux-gnu_libopensc.so.6.0.0",
},
}
assert.Equal(t, expected, mappings)

0 comments on commit ebbfd56

Please sign in to comment.