Subject: [Boost-bugs] [Boost C++ Libraries] #10900: read_symlink fails to correctly read NTFS junctions
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-12-26 16:16:26
#10900: read_symlink fails to correctly read NTFS junctions
------------------------------------------------+------------------------
Reporter: Benjamin Kummer-Hardt <benjamin@â¦> | Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.57.0 | Severity: Problem
Keywords: |
------------------------------------------------+------------------------
''Tested on Windows 7 64-bit.''
NTFS directory junctions are now recognized as a symlink by
`is_reparse_point_a_symlink` but `read_symlink` does not correctly handle
those "mount point" reparse points yet.
Among other things this also breaks the `canonical` operation.
The `REPARSE_DATA_BUFFER` returned by `DeviceIoControl` needs to be
accessed differently for regular symlinks and mount points. See
msdn.microsoft.com/en-us/library/ff552012.aspx
Accessing the "!PrintName" as a symlink typically results in the first two
(wide) characters of the path being skipped and generally in undefined
behavior.
A possible fix would be to add a conditional statement checking
`info.rdb.ReparseTag == IO_REPARSE_TAG_MOUNT_POINT` and then amend the
`symlink_path.assign` call accordingly (using
`info.rdb.MountPointReparseBuffer` instead of
`info.rdb.SymbolicLinkReparseBuffer`).
In version 1.57.0 the offending code can be found in
''libs/filesystem/src/operations.cpp'' around line 1514.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10900> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC