2008-05-20 Corinna Vinschen <corinna@vinschen.de>
+ * path.cc (symlink_info::check_shortcut): Minimize requested file
+ access flags.
+ (symlink_info::check_sysfile): Ditto. Add missing `else'.
+ (symlink_info::check): Only retry to open file if first try failed
+ with access denied.
+
+2008-05-20 Corinna Vinschen <corinna@vinschen.de>
+
* path.cc (fs_info::update): Re-add opening the unsplitted path
for fillout_mntent's sake.
FILE_STANDARD_INFORMATION fsi;
InitializeObjectAttributes (&attr, &same, 0, in_h, NULL);
- status = NtOpenFile (&h, FILE_GENERIC_READ,
+ status = NtOpenFile (&h, FILE_READ_DATA | SYNCHRONIZE,
&attr, &io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT
| FILE_SYNCHRONOUS_IO_NONALERT);
IO_STATUS_BLOCK io;
InitializeObjectAttributes (&attr, &same, 0, in_h, NULL);
- status = NtOpenFile (&h, FILE_GENERIC_READ,
+ status = NtOpenFile (&h, FILE_READ_DATA | SYNCHRONIZE,
&attr, &io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT
| FILE_SYNCHRONOUS_IO_NONALERT);
if (!NT_SUCCESS (status))
set_error (EIO);
- if (!NT_SUCCESS (status = NtReadFile (h, NULL, NULL, NULL, &io, cookie_buf,
- sizeof (cookie_buf), NULL, NULL)))
+ else if (!NT_SUCCESS (status = NtReadFile (h, NULL, NULL, NULL, &io,
+ cookie_buf, sizeof (cookie_buf),
+ NULL, NULL)))
{
debug_printf ("ReadFile1 failed");
if (status != STATUS_END_OF_FILE)
FILE_OPEN_REPARSE_POINT
| FILE_OPEN_FOR_BACKUP_INTENT,
&nfs_aol_ffei, sizeof nfs_aol_ffei);
- if (!NT_SUCCESS (status))
+ if (status == STATUS_ACCESS_DENIED) /* No right to access EAs? */
{
no_ea = true;
status = NtCreateFile (&h,