Corrupted file name in Cygwin - does Cygwin do a silly rename if a file is open?

Cedric Blancher cedric.blancher@gmail.com
Sat Nov 23 13:53:21 GMT 2024


Good afternoon!

Does Cygwin do a silly rename if a Cygwin file is open but gets
/bin/rm at the same time?

What I see is that on a NFSv4.1 filesystem a

bash -c 'touch sillytest ; ls -l ; ( command exec {n}<"sillytest" ;
print $n ; sleep 10) & sleep 1 ; ls -la ; rm -f sillytest ; ls -la ;
wait'

will send invalid characters over the network.
At first I thought it's a bug in the ms-nfs41-client filesystem
driver, but if I replace the rm -f sillytest with a cmd /C "del
sillytest" the garbage filename data goes away:

bash -c 'touch sillytest ; ls -l ; ( command exec {n}<"sillytest" ;
printf "fd=%d\n" $n ; sleep 10) & sleep 1 ; ls -la ; cmd /C "del
sillytest" ; ls -la ; wait'

I think doing a /bin/rm on an opened file causes Cygwin to rename the
file, but the destination file name is corrupted or comes from
uninitialized memory.

Ced
-- 
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur


More information about the Cygwin mailing list