* fhandler_disk_file.cc (readdir_get_ino): Accommodate native symlinks.

* syscalls.cc (rename): Ditto.
This commit is contained in:
Corinna Vinschen 2007-08-02 15:13:56 +00:00
parent 64a62f4cfe
commit e809fec984
3 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2007-08-02 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (readdir_get_ino): Accommodate native symlinks.
* syscalls.cc (rename): Ditto.
2007-08-02 Christopher Faylor <me+cygwin@cgf.cx>
* lib/Makefile: Add missed file to accommodate below changes.

View File

@ -1717,7 +1717,9 @@ readdir_get_ino (const char *path, bool dot_dot)
else if (NT_SUCCESS (NtOpenFile (&hdl, READ_CONTROL,
pc.get_object_attr (attr, sec_none_nih),
&io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT)))
FILE_OPEN_FOR_BACKUP_INTENT
| (pc.is_rep_symlink ()
? FILE_OPEN_REPARSE_POINT : 0))))
{
ino = readdir_get_ino_by_handle (hdl);
NtClose (hdl);

View File

@ -1516,7 +1516,9 @@ rename (const char *oldpath, const char *newpath)
/* DELETE is required to rename a file. */
status = NtOpenFile (&fh, DELETE, oldpc.get_object_attr (attr, sec_none_nih),
&io, FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT);
&io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT
| (oldpc.is_rep_symlink () ? FILE_OPEN_REPARSE_POINT : 0));
if (!NT_SUCCESS (status))
{
__seterrno_from_nt_status (status);
@ -1535,7 +1537,10 @@ rename (const char *oldpath, const char *newpath)
&& ofsi.NumberOfLinks > 1
&& NT_SUCCESS (NtOpenFile (&nfh, READ_CONTROL,
(removepc ?: dstpc)->get_object_attr (attr, sec_none_nih),
&io, FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT)))
&io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT
| ((removepc ?: dstpc)->is_rep_symlink ()
? FILE_OPEN_REPARSE_POINT : 0))))
{
static const size_t vsiz = sizeof (FILE_FS_VOLUME_INFORMATION)
+ 32 * sizeof (WCHAR);