Opened 6 years ago

Last modified 15 months 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 Changed 5 years ago by patrick.reynolds@…

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

comment:2 in reply to:  1 Changed 5 years ago by patrick.reynolds@…

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

comment:3 Changed 15 months ago by mika.heiskanen@…

The issue remains in version 1.65.

Note: See TracTickets for help on using tickets.