Repository navigation
Conversation
Meo597
requested changes
Oct 24, 2026
Meo597
left a comment
Collaborator
There was a problem hiding this comment.
golang/go#63703 (comment)
这搞出许多麻烦,管杀不管埋的
但无论如何都不该去碰句柄,这不合适
这里只是简单检查扩展名,并不是绝对的安全保障,因此不该太复杂
可以把所有原来 EvalSymlinks 的都改为:
先 os.Lstat 再根据 info.Mode()&os.ModeSymlink != 0 来 EvalSymlinks
这么干的话 junction + 符号连接混合的仍然会报错,不照顾这种 edge case
Collaborator
|
No response for a long time; I'll handle it myself. |
RPRX
pushed a commit
that referenced
this pull request
Oct 28, 2026
#7250 (comment) Fixes #7239 (comment) --------- Co-authored-by: Eljees <3.14hell@gmail.com>
RPRX
pushed a commit
that referenced
this pull request
Oct 28, 2026
#7255 (comment) #7250 (comment) Fixes #7239 (comment) --------- Co-authored-by: Eljees <3.14hell@gmail.com>
Collaborator
|
被他全自动 agent 蹭到了 co-author |
Member
|
|
Collaborator
|
跟知名大神 阿酥在coding 干的事儿差不多 |
Collaborator
|
被蹭了就蹭吧,只是吐槽下 |
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 #7239.
On Windows,
xray run -c config.jsoncan fail when its working directory contains a directory junction: opening the file succeeds, butfilepath.EvalSymlinksreturns "The system cannot find the path specified." Reproduced with the official v26.10.21 Windows release and Go 1.27.3 on Windows 11 (build 26100).Resolve the final Windows path from the already opened file handle with
GetFinalPathNameByHandle, keeping the allowed-extension check on the resolved target. Resolver errors remain fatal. Other platforms retain the existing absolute-path and symlink resolution. The command and regular-file gates are unchanged.Regression tests use a real directory junction and a child process whose working directory is the junction, covering relative and absolute config paths. Tests also cover UTF-16 buffer growth, closed handles, the extension allowlist, pipe/other-command behavior, and symlink target extensions.
Validation on the submitted commit:
Configuration OKfor the physical path and both junction cases.go test -count=1 ./main/confloader/... ./main/commands/baseand affectedgo vetpass on Windows (Go 1.27.3). The affected suite also passes with-raceon Linux (Go 1.27.1).git diff --checkpass.AI assistance (OpenAI Codex) was used for implementation, tests, and review; the validation commands above were run locally.