Opened 10 years ago

Last modified 5 years ago

#7273 new Bugs

Files created by boost::iostreams::mapped_file have unexpected permissions on Linux

Reported by: Mika Fischer <mika.fischer@…> Owned by: Jonathan Turkanis
Milestone: To Be Determined Component: iostreams
Version: Boost 1.51.0 Severity: Problem
Keywords: Cc:

Description

The mapped_file class opens the file unconditionally via:

::open(p.path.c_str(), flags, S_IRWXU);

Which sets the permissions to read, write, execute for the owner and no permissions for group or others.

This is quite unexpected, and since it cannot be changed by the caller, I think a more sane default behavior would be to just use the default of open and let the user's umask decide the permission of newly created files.

I.e. just remove the last parameter:

::open(p.path.c_str(), flags);

Change History (3)

comment:1 by patrick.reynolds@…, 9 years ago

Hi Folks, I'm seeing the same issue on Boost 1.55.0.

in reply to:  1 comment:2 by patrick.reynolds@…, 9 years ago

It wouldn't let me post a link, but a put in a PR on github.

comment:3 by mika.heiskanen@…, 5 years ago

The issue remains in version 1.65.

Note: See TracTickets for help on using tickets.