Modify

Opened 7 years ago

Closed 6 years ago

#4979 closed Bugs (fixed)

shared_memory_object open_only ctor resets permissions to default

Reported by: Bob Dempsey <rdempsey@…> Owned by: igaztanaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.45.0 Severity: Problem
Keywords: Cc:

Description

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.

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by igaztanaga

  • Resolution set to fixed
  • Status changed from new to closed

Updated SVN code. Permissions updated only when the shm is created. Thanks for the report.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain igaztanaga.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.