Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] Growing resets permissions
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2012-09-12 14:40:01


El 10/09/2012 18:28, Aaron_Wright_at_[hidden] escribió:
> I have a situation where I don't know how much shared memory I
> need, so I made the shared memory grow when it ran out of space. My shared
> memory is shared between a process running as root and postgres, which
> won't run as root. So I set the permissions to unrestricted (0666) when I
> create the shared memory. My problem is that when I grow the shared
> memory, the permissions are reset to (0644). This breaks things, as
> postgres can no longer open the shared memory for writing.
>
> 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."
>
> Has anyone else ran into this? What is the easy solution? Should I
> just set the permissions manually after growing? Is this a bug in the
> interprocess library?

I didn't know about this ftruncate behavior. Please fill a ticket to
Interprocess, as I think it should try to maintain original permissions.

Best,

Ion


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net