Page MenuHomeFreeBSD

Resolve relative argv0 for direct exec mode to absolute path for AT_EXECPATH.
ClosedPublic

Authored by kib on Jan 2 2020, 11:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 4:33 AM
Unknown Object (File)
Oct 4 2024, 4:33 PM
Unknown Object (File)
Oct 4 2024, 7:09 AM
Unknown Object (File)
Oct 3 2024, 11:47 PM
Unknown Object (File)
Oct 1 2024, 3:35 PM
Unknown Object (File)
Sep 30 2024, 12:20 AM
Unknown Object (File)
Sep 6 2024, 9:03 PM
Unknown Object (File)
Sep 5 2024, 12:36 PM
Subscribers

Details

Summary

realpath(3) was already linked into ld-elf.so.1, so I reused it there to resolve dots and dotdots making the path more canonical.

[as promised]

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib retitled this revision from Resolve relative arv0 for direct exec mode to absolute path for AT_EXECPATH. to Resolve relative argv0 for direct exec mode to absolute path for AT_EXECPATH..Jan 3 2020, 1:19 AM
kib edited the summary of this revision. (Show Details)
This revision was not accepted when it landed; it landed in state Needs Review.Jan 9 2020, 10:00 AM
This revision was automatically updated to reflect the committed changes.
head/libexec/rtld-elf/rtld.c
5567

won't realpath already convert res to an absolute path? I think that this code will convert ./bar with pwd /tmp into /tmp/tmp/bar

head/libexec/rtld-elf/rtld.c
5567

Of course you are right. Please see D23121