The path resolution doesn't correctly work for a set of file cases
(e.g. symlinks to binaries or shared libraries).
One setup example is using 9pfs and the entire root local filesystem,
while running the "ls" binary and loading the shared libraries:
unikraft/support/scripts/qemu-guest -k build/app-elfloader_qemu-x86_64
-e / -a "/bin/ls /"
A "/" character is omitted from the last part of the path e.g. "/binls"
instead of "/bin/ls". Update the logic to include the missing character.
Signed-off-by: Andra Paraschiv <andra@unikraft.org>
Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com>
Reviewed-by: Ioan-Teodor Teugea <ioan_teodor.teugea@stud.acs.upb.ro>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #883
}
link[sz] = 0;
- p = fp + mountpoint_len + strlen(node);
+ p = fp + mountpoint_len + strlen(node) - 1;
c = strlen(node) - strlen(name) - 1;
node[c] = 0;