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)
Sat, Mar 21, 7:11 AM
Unknown Object (File)
Sat, Mar 21, 4:33 AM
Unknown Object (File)
Thu, Mar 19, 4:37 AM
Unknown Object (File)
Tue, Mar 17, 5:46 PM
Unknown Object (File)
Fri, Mar 13, 1:14 AM
Unknown Object (File)
Wed, Mar 11, 4:48 PM
Unknown Object (File)
Wed, Mar 11, 1:17 PM
Unknown Object (File)
Thu, Feb 26, 4:06 AM
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