diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2019-01-09 21:41:48 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2019-01-09 21:48:43 +0100 |
commit | b7a6d357ee23d690a6559235600b85801d6ad025 (patch) | |
tree | 23e71e4a6ac88daf16926e291667e8a85bc5d7e1 | |
parent | ec457e0351eee30c0d7319524e6a1a36f94dfb35 (diff) | |
download | cygnal-b7a6d357ee23d690a6559235600b85801d6ad025.tar.gz cygnal-b7a6d357ee23d690a6559235600b85801d6ad025.tar.bz2 cygnal-b7a6d357ee23d690a6559235600b85801d6ad025.zip |
Cygwin: try_to_bin: fix rootdir handle after reopening
If the first rename fails, we reopen the rootdir for creating a subdir.
The rootdir handle can change its value at this point, but the code
doesn't take this into account. The subsequent rename then fails with
STATUS_INVALID_HANDLE. Fix this by copying the new rootdir value to
pfri->RootDirectory.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | winsup/cygwin/syscalls.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 4f91f4b48..728a6b1e5 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -389,6 +389,8 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access, ULONG flags) &recycler, status); goto out; } + /* Correct the rootdir HANDLE in pfri after reopening the dir. */ + pfri->RootDirectory = rootdir; /* Then check if recycler exists by opening and potentially creating it. Yes, we can really do that. Typically the recycle bin is created by the first user actually using the bin. */ |