From 2b41d940ca494e132cbc8653edcfc8fb1b5b8cab Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 15 Aug 2008 10:19:12 +0000 Subject: [PATCH] * path.cc (symlink_info::check): Don't use eabuf when trying to open file a second time. Call NtOpenFile instead of NtCreateFile in this case. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/path.cc | 14 ++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 769bae842..46d7b6dc9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2008-08-15 Corinna Vinschen + + * path.cc (symlink_info::check): Don't use eabuf when trying to open + file a second time. Call NtOpenFile instead of NtCreateFile in this + case. + 2008-08-14 Corinna Vinschen * fhandler_disk_file.cc (fhandler_disk_file::link): Fix linking diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 4a91ff876..454efadeb 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2356,8 +2356,8 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt, to special case NFS too much. */ status = NtCreateFile (&h, READ_CONTROL | FILE_READ_ATTRIBUTES | FILE_READ_EA, - &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, - FILE_SHARE_VALID_FLAGS, FILE_OPEN, + &attr, &io, NULL, 0, FILE_SHARE_VALID_FLAGS, + FILE_OPEN, FILE_OPEN_REPARSE_POINT | FILE_OPEN_FOR_BACKUP_INTENT, eabuf, easize); @@ -2372,12 +2372,10 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt, eabuf = NULL; easize = 0; } - status = NtCreateFile (&h, READ_CONTROL | FILE_READ_ATTRIBUTES, - &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, - FILE_SHARE_VALID_FLAGS, FILE_OPEN, - FILE_OPEN_REPARSE_POINT - | FILE_OPEN_FOR_BACKUP_INTENT, - eabuf, easize); + status = NtOpenFile (&h, READ_CONTROL | FILE_READ_ATTRIBUTES, + &attr, &io, FILE_SHARE_VALID_FLAGS, + FILE_OPEN_REPARSE_POINT + | FILE_OPEN_FOR_BACKUP_INTENT); } if (NT_SUCCESS (status) && NT_SUCCESS (status