Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost Interprocess: Sharing memory among different users
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2008-09-26 10:24:03


Silvio Reis Junior wrote:
> Hello folks!
> I'm writing a software for the Linux environment. I'll need to share
> data between a daemon and a program running on the user's context.
> I chose to use shared memory because it's faster.
> I'm trying to use boost::interprocess::shared_memory_object but I'm
> facing a problem:
> When I access the shared memory in my test case running in the same user
> context, everything works fine.
> But when I access it using a program running in the current user when
> the shared memory was created as root, I get an access denied error.
> I searched in the documentation for a way to enable access to all users
> but I found nothing.
> Is there a way to do it?

Sorry for the late reply. The short answer is: not yet. We would need to
change the interface so that the programmer can pass permissions to the
creation of the shared memory object descriptor funcion. Another idea
would be to use chmod to change permissions of the shared memory file so
that it can be shared with users.

I would want to add support for permissions, but I don't think I will
have to do this for Boost 1.37.

> Thanks in advance.
> Silvio.

Regards,

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