For example, from the referenced PR [1]:
$ mkdir /tmp/lib/ /tmp/libexec
$ touch /tmp/lib/foo.so
$ install -lrs /tmp/lib/foo.so /tmp/libexec/
The common path identification bits terminate src at /tmp/lib/ and the
destination at /tmp/libe. The subsequent backtracking is then incorrect, as
it traverses the destination and backtraces exactly one level while eating
the 'libexec' because it was previously (falsely) identified as common with
'lib'.
The obvious fix would be to make sure we've actually terminated just after
directory separators and rewind a character if we haven't. In the above
example, we would end up rewinding to /tmp/ and subsequently doing the right
thing.
Test case added.
PR: 235330 [1]
MFC after: 1 week
The additional testcases use absolute paths for sources and targets,
as the other testcase which tested `-l sr` used flat relative paths in
the same directory.
Please note that these testcases do not test `-l a` -- that's already
addressed in the battery of tests.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Unfortunately kyua does not omit the path mismatch on failure, so it must be coded
into the error message.
Cache the values, run the test(1) call, then print out the values in an atf_fail
call to emit the required diagnostics to debug why things are failing.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
This should fix the build on older stable/10, since install is a bootstrap
tool.
Pending a decision how to fix this properly, revert utimensat usage. Copies
with the -p option will again appear older than the original almost always,
but -p is not commonly used.