[Boost-bugs] [Boost C++ Libraries] #8301: filesystem::canonical() has a race condition on Windows 7

Subject: [Boost-bugs] [Boost C++ Libraries] #8301: filesystem::canonical() has a race condition on Windows 7
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-18 02:43:58


#8301: filesystem::canonical() has a race condition on Windows 7
------------------------------+---------------------------------------------
 Reporter: y.hoshizuki | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.51.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 read_symlink() often throws a exception.

 to confirm this problem, please compile and run the attached file.

 i think it caused by read_symlink() opening a file exclusively.

 {{{
     handle_wrapper h(
       create_file_handle(p.c_str(), GENERIC_READ, 0, 0, OPEN_EXISTING,
         FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0));
 }}}

 FILE_SHARE_READ argument resolves this problem, isn't it?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8301>
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:12 UTC