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)
Thu, Apr 25, 9:20 AM
Unknown Object (File)
Feb 24 2024, 1:21 AM
Unknown Object (File)
Feb 24 2024, 1:21 AM
Unknown Object (File)
Feb 24 2024, 1:10 AM
Unknown Object (File)
Feb 24 2024, 12:47 AM
Unknown Object (File)
Feb 7 2024, 12:00 AM
Unknown Object (File)
Jan 23 2024, 2:12 PM
Unknown Object (File)
Dec 24 2023, 12:32 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