Skip to content

syscall: preserve Cygwin UNC roots in ownership walks - #1113

Merged
steadytao merged 2 commits into
masterfrom
cygwin-unc-paths
Oct 3, 2026
Merged

steadytao merged 2 commits into
masterfrom
cygwin-unc-paths

Conversation

@steadytao

Copy link
Copy Markdown
Member

Fixes #1105

Summary

Preserve //server/share as the resolution anchor when the ownership-checked path walker opens an absolute path on Cygwin.

We treated every path beginning with / as POSIX-absolute, opened / and removed every leading slash. This changed //server/share/path into /server/share/path and caused UNC destinations to fail with ENOENT. The UNC share is now opened as the trusted root. Components below the share continue through the existing ownership-checked walk. Trusted symlinks which expand to UNC paths use the same handling.

@steadytao

Copy link
Copy Markdown
Member Author

@sdbbs please test

@sdbbs

sdbbs commented Oct 2, 2026 •

Copy link
Copy Markdown

Thanks @steadytao :

please test

I'm not sure exactly how, I'd need an executable; unfortunately I'm too busy right now to build from source.

I noticed on https://packages.msys2.org/packages/rsync there was a rsync build, newer than the one I was complaining about:

Version: 3.5.1-2
...
Build Date: 2026-09-30 18:32:03

... so I updated MSYS2 with pacman -Syu, I could see new rsync package get downloaded, however it still prints rsync version 3.5.1 protocol version 33 for --version, so I cannot tell if it packages the patches you've made. This new version I tried from pacman still does not work, unfortunately:

$ rsync -aP myfile.txt //192.168.1.10/MyShare/mydir/
sending incremental file list
rsync: [Receiver] change_dir#1 "//192.168.1.10/MyShare/mydir/" failed: No such file or directory (2)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(781) [Receiver=3.5.1]
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(879) [sender=3.5.1]

$ ls -lad //192.168.1.10/MyShare/mydir/
drwxr-xr-x 1 user None 0 Sep 28 14:51 //192.168.1.10/MyShare/mydir//

If you have a suggestion how can I obtain an executable quickly, I don't mind testing. Thanks again for the help!

@steadytao

Copy link
Copy Markdown
Member Author

rsync.tar.gz

@sdbbs Just pulled the build from the Cygwin CI job. Let me know if it doesn't work.

@sdbbs

This comment was marked as resolved.

@seks99x

seks99x commented Oct 2, 2026

Copy link
Copy Markdown
Member

Chill mate, it happens. You could've easily installed all that missing dependencies with cygwin setup-x86_64.exe . When setting it up ,Select Packages section contain all the dependencies and is easily installed from the GUI setup (or setup-x86.exe -q -P package1,package2). I think also AI do know that clearly and should've said that.

@steadytao

Copy link
Copy Markdown
Member Author

Eh I do more or less agree on the fact that AI does piss me off a lot of the time. But, yeah, preferably dont be overly doomer with things; we can strive to do better.

@steadytao

Copy link
Copy Markdown
Member Author

Thank you for testing nonetheless.

@steadytao
steadytao merged commit 013f76d into master Oct 3, 2026
20 checks passed
@sdbbs

sdbbs commented Oct 3, 2026

Copy link
Copy Markdown

Thanks for merging - and sorry about my burst (handling this issue was only the final thing in that day of mine, where also everything else went wrong); I have edited my comment, and uploaded the missing script. Thanks again!

@steadytao

Copy link
Copy Markdown
Member Author

It is no worries at all. I completely understand where the frustration comes from and we all need time to get that out occasionally. Thank you for reporting the issue and helping me confirm this fix works.

@steadytao
steadytao deleted the cygwin-unc-paths branch October 3, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[3.5.x regression] 'change_dir failed: No such file or directory' on Cygwin/MSYS2 UNC paths

3 participants