[Boost-bugs] [Boost C++ Libraries] #4979: shared_memory_object open_only ctor resets permissions to default

Subject: [Boost-bugs] [Boost C++ Libraries] #4979: shared_memory_object open_only ctor resets permissions to default
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-12-13 18:17:01


#4979: shared_memory_object open_only ctor resets permissions to default
------------------------------------------------+---------------------------
 Reporter: Bob Dempsey <rdempsey@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.45.0 | Severity: Problem
 Keywords: |
------------------------------------------------+---------------------------
 Because of a call to ::fchmod() in
 shared_memory_object::priv_open_or_create, if you use attempt to open a
 shm segment using the open_only tag, you will always reset the existing
 perms to the default. These 3 lines are the problem:

 {{{
    if(m_handle >= 0){
       ::fchmod(m_handle, perm.get_permissions());
    }
 }}}

 If you delete these lines (on Linux, anyway) things looks right. I don't
 know why those lines are there, but if they are needed for portability,
 perhaps something like

 {{{
    if(m_handle >= 0 && type != detail::DoOpen){
       ::fchmod(m_handle, perm.get_permissions());
    }
 }}}

 might work better.

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