* syscalls.cc (unlink_nt): Open native symlinks with

FILE_OPEN_REPARSE_POINT flag.
This commit is contained in:
Corinna Vinschen 2006-12-07 17:53:05 +00:00
parent 1c9b2968fa
commit e563a4d5b8
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2006-12-07 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (unlink_nt): Open native symlinks with
FILE_OPEN_REPARSE_POINT flag.
2006-12-07 Corinna Vinschen <corinna@vinschen.de>
* ntdll.h (STATUS_DELETE_PENDING): Define.

View File

@ -207,6 +207,10 @@ unlink_nt (path_conv &win32_name, bool setattrs)
2K3 and in all cases, DeleteFile works, "delete on close" does not. */
if (!win32_name.isremote ())
flags |= FILE_DELETE_ON_CLOSE;
/* Add the reparse point flag to native symlinks, otherwise we remove the
target, not the symlink. */
if (win32_name.is_rep_symlink ())
flags |= FILE_OPEN_REPARSE_POINT;
win32_name.get_nt_native_path (upath);
InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE | OBJ_INHERIT,