On Thu, Feb 20, 2025 at 9:37 PM Corinna Vinschen via Cygwin <cygwin@cygwin.com> wrote: > > On Feb 20 19:24, Lionel Cons via Cygwin wrote: > > On Thu, 20 Feb 2025 at 18:09, Corinna Vinschen via Cygwin > > <cygwin@cygwin.com> wrote: > > > > > > On Feb 20 17:37, Lionel Cons via Cygwin wrote: > > > > On Thu, 20 Feb 2025 at 14:56, Cedric Blancher via Cygwin > > > > <cygwin@cygwin.com> wrote: > > > > > > > > > > Good afternoon! > > > > > > > > > > Cygwin 3.6.0-0.378.g78fb13d21f4f.x86_64, Cygwin coreutils package > > > > > 9.6-1 > > > > > > > > > > coreutils mkdir is broken on UNC paths: > > > > > > > > > > mkdir -p -- > > > > > "//ember.data4.local/afs/disk11/builds/bash/install_root/usr/local/bin" > > > > > mkdir: cannot create directory ‘//ember.data4.local’: Read-only file > > > > > system > > > > > > > > > > This happens because you cannot do a "cd .." in > > > > > //ember.data4.local/afs, because "afs" is the UNC prefix for that > > > > > filesystem. > > > > > > > > No, it happens because mkdir "//ember.data4.local" returns "Read-only > > > > file system". If Cygwin would just return EEXIST if this mount exists, > > > > then this whole mkdir -p would work. > > > > > > You know exactly what Cygwin is doing wrong, great! > > > > Sorry, it has been a very long day, and I did not communicate my point > > precisely. > > My point is that mkdir("//ember.data4.local") for a share should in my > > opinion not return EROFS, because the share already exists. > > > > Looking at the code: > > int > > fhandler_base::mkdir (mode_t) > > { > > if (exists ()) > > set_errno (EEXIST); > > else > > set_errno (EROFS); > > return -1; > > } > > > > My guess is that exists() fails. The why? and how? I do not know. > > And here's the problem. It works fine for me on all shares, be it SMB, > Samba, or NFS: > > https://cygwin.com/pipermail/cygwin/2025-February/257438.html > > > Maybe the hostname resolution in fhandler_netdrive::exists() failed? > > If so, it would be a problem on your side. > Does `nslookup ember.data4.local' return a valid address? > > I just pushed a patch to print a debug statement in strace output > to see what error code GetAddrInfoW returned.
The code in https://cygwin.com/git/?p=newlib-cygwin.git;a=commitdiff;h=df307349a09e6f1ba75c78b1427dcea40f435e6e;hp=8a8fb570d7c5310a03a34b3dd6f9f8bb35ee9f40 is not going to work, because you only give ret as argument, but not "name+2" as hostname. And speaking of the "hostname", is this the \\hostname\path of an UNC? In that case this will not work with WebDAV/SSL or WebDAV with custom port, which might be \\webdavserver@SSL\path or \\webdavserver@23456\path, or \\webdavserver@SSL@23456\path You need to replace the L'@' with L'\0' before calling GetAddrInfoW(), or it is not going to work with WebDAV The spec for that is in https://learn.microsoft.com/en-us/windows/win32/api/davclnt/nf-davclnt-davgethttpfromuncpath Thanks, Martin -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple