Opened 10 years ago

#7369 new Bugs

grow() resets permissions

Reported by: Aaron Wright <Aaron_Wright@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

I need to create shared memory with unrestricted permissions (0666). This works fine. When I attempt to grow the shared memory, using the grow() function, the permissions get reset to 0644.

I followed the code a bit and saw that it was using ftruncate. Checking the man page for ftruncate reveals, "the set-user-ID and set-group-ID permission bits may be cleared." Not sure what affects the "may" clause, but it did it every time for me. Umask was set to 0000.

Obviously this only effects systems using ftruncate. Windows works correctly.

Not sure on what versions may be needed, but: libc6 - 2.11.1 libglib2.0 - 2.24.1 gcc - 4.4.3

Change History (0)

Note: See TracTickets for help on using tickets.