e698eed7c7
_resolveNearestExistingPath safely resolves symbolic links by traversing up the tree until an ancestor exists, but it previously dropped the components of the path that were skipped. This causes non-existent dummy paths used in tests to incorrectly resolve to filesystem roots (like C:\ on Windows or / on POSIX), causing permission check failures. This fix computes the relative path suffix between the original path and the closest existing ancestor using path.relative, and appends it back to the resolved path with path.join. POSIX dummy path coverage has also been added to verify identical behavior across platforms. Fixes: https://github.com/dart-lang/sdk/issues/63147 Change-Id: Iac908998f052ad9054e8213ba059156a5982a301 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495000 Reviewed-by: Jessy Yameogo <yjessy@google.com> Auto-Submit: Ben Konyi <bkonyi@google.com> Commit-Queue: Jessy Yameogo <yjessy@google.com>