Repository navigation
Fix file creation through dangling symbolic links - #532
Open
YuqiGuo105 wants to merge 1 commit into
Open
YuqiGuo105 wants to merge 1 commit into
YuqiGuo105 wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Respect link-following options when creating a regular file, and use the resolved directory-entry name for the new target. Preserve CREATE_NEW, NOFOLLOW_LINKS and directory/link creation behavior. Add regression coverage for relative and absolute targets, link chains, initial attributes, stream/channel APIs and Windows roots. Fixes google#254 Assisted-by: OpenAI Codex Signed-off-by: YuqiGuo105 <131561736+YuqiGuo105@users.noreply.github.com>
YuqiGuo105
force-pushed
the
fix/issue-254-dangling-symlink
branch
from
November 4, 2026 07:50
6d6853c to
ee2644b
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #254.
Summary
Allow creating a regular file through a symbolic link whose target does not yet exist, without replacing the link.
The initial read-locked lookup already follows symbolic links, but the creation path unconditionally looked up the link with
NOFOLLOW_LINKSand rejected it as "not a regular file". The current path resolver can already represent a missing target as aDirectoryEntry; no resolver changes are needed.Changes
CREATE_NEW, explicitNOFOLLOW_LINKS, directory creation and symbolic-link creation semantics.No public API changes. Open-PR searches for the issue number and related keywords found no competing fix before submission.
Validation
macOS arm64, Temurin JDK 25.0.3, Maven 3.9.16; the project retains its Java 8 source/target configuration.
Before the production fix, the new Unix tests reported 10 tests, 5 errors, and the Windows test reported 1 test, 1 error, all six errors being
FileSystemException: ... not a regular file:After the fix, all 11 targeted tests passed. Full verification was rerun before submission:
BUILD SUCCESS — 5,917 tests, 0 failures, 0 errors, 1 existing skipped test (
JimfsFileChannelTest.testCloseByInterrupt). Packaging and Javadoc generation completed. Google Java Format 1.35.0 checks on the changed regions andgit diff --checkalso passed.AI assistance: OpenAI Codex assisted with implementation and local validation.