* path.cc (symlink_info::check): Drop PC_KEEP_HANDLE flag for
unrecognized reparse points as well. Reorganize code and comments handling reparse points for better readability.
This commit is contained in:
parent
8f81761b69
commit
492ee4ee4b
@ -1,3 +1,9 @@
|
|||||||
|
2013-04-12 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* path.cc (symlink_info::check): Drop PC_KEEP_HANDLE flag for
|
||||||
|
unrecognized reparse points as well. Reorganize code and comments
|
||||||
|
handling reparse points for better readability.
|
||||||
|
|
||||||
2013-04-11 Corinna Vinschen <corinna@vinschen.de>
|
2013-04-11 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* hires.h (hires_ns::nsecs): Declare with bool parameter.
|
* hires.h (hires_ns::nsecs): Declare with bool parameter.
|
||||||
|
@ -2653,26 +2653,28 @@ restart:
|
|||||||
if ((fileattr & FILE_ATTRIBUTE_REPARSE_POINT))
|
if ((fileattr & FILE_ATTRIBUTE_REPARSE_POINT))
|
||||||
{
|
{
|
||||||
res = check_reparse_point (h, fs.is_remote_drive ());
|
res = check_reparse_point (h, fs.is_remote_drive ());
|
||||||
if (res == -1)
|
if (res > 0)
|
||||||
{
|
{
|
||||||
/* Volume mount point. The filesystem information for the top
|
/* A symlink is never a directory. */
|
||||||
|
conv_hdl.fnoi ()->FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Volume moint point or unrecognized reparse point type.
|
||||||
|
Make sure the open handle is not used in later stat calls.
|
||||||
|
The handle has been opened with the FILE_OPEN_REPARSE_POINT
|
||||||
|
flag, so it's a handle to the reparse point, not a handle
|
||||||
|
to the volumes root dir. */
|
||||||
|
pflags &= ~PC_KEEP_HANDLE;
|
||||||
|
/* Volume mount point: The filesystem information for the top
|
||||||
level directory should be for the volume top level directory,
|
level directory should be for the volume top level directory,
|
||||||
rather than for the reparse point itself. So we fetch the
|
rather than for the reparse point itself. So we fetch the
|
||||||
filesystem information again, but with a NULL handle.
|
filesystem information again, but with a NULL handle.
|
||||||
This does what we want because fs_info::update opens the
|
This does what we want because fs_info::update opens the
|
||||||
handle without FILE_OPEN_REPARSE_POINT. */
|
handle without FILE_OPEN_REPARSE_POINT. */
|
||||||
fs.update (&upath, NULL);
|
if (res == -1)
|
||||||
/* Make sure the open handle is not used in later stat calls.
|
fs.update (&upath, NULL);
|
||||||
The handle has been opened with the FILE_OPEN_REPARSE_POINT
|
|
||||||
flag, so it's a handle to the reparse point, not a handle
|
|
||||||
to the volumes root dir. */
|
|
||||||
pflags &= ~PC_KEEP_HANDLE;
|
|
||||||
}
|
|
||||||
else if (res)
|
|
||||||
{
|
|
||||||
/* A symlink is never a directory. */
|
|
||||||
conv_hdl.fnoi ()->FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user