6ed4753e77
If newfile already exists and is in use, trying to overwrite it with NtSetInformationFile(FileRenameInformation) fails exactly as if we don't have the permissions to delete it. Unfortunately the return code is the same STATUS_ACCESS_DENIED, so we have no way to distinguish these cases. What we do here so far is to start a transaction to delete newfile. If this open fails with a transactional error we stop the transaction and retry opening the file without transaction. But, here's the problem: If newfile is in use, NtOpenFile(oldfile) naturally does NOT fail with a transactional error. Rather, the subsequent call to unlink_nt(newfile) does, because there's another handle open to newfile outside a transaction. However, the code does not check if unlink_nt fails with a transactional error and so fails to retry without transaction. This patch recifies the problem and checks unlink_nt's status as well. Refactor code to get rid of goto into another code block. Signed-off-by: Corinna Vinschen <corinna@vinschen.de> |
||
---|---|---|
.. | ||
CVSChangeLogs.old | ||
cygserver | ||
cygwin | ||
doc | ||
lsaauth | ||
testsuite | ||
utils | ||
CONTRIBUTORS | ||
COPYING | ||
COPYING.LIB | ||
CYGWIN_LICENSE | ||
Makefile.common | ||
Makefile.in | ||
README | ||
acinclude.m4 | ||
aclocal.m4 | ||
autogen.sh | ||
c++wrap | ||
ccwrap | ||
config.guess | ||
config.sub | ||
configure | ||
configure.ac | ||
configure.cygwin | ||
install-sh |
README
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cygwin documentation is available on the net at https://cygwin.com You might especially be interested in https://cygwin.com/faq/faq.html#faq.programming.building-cygwin