Re: Shared Memory Access Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11 September 2012 17:23, Bob Furber wrote:
> On 12-09-07 04:08 PM, Jonathan Wakely wrote:
>>
>> On 8 September 2012 00:03, Bob Furber wrote:
>>>
>>>
>>> Why is the client capable of accessing shared memory when executed by
>>> root
>>> and not able to, when executed by a user?
>>
>>
>> This doesn't sound like it has anything to do with GCC.
>
>
> After a lot of experimentation, I think the problem lies in shm_open().

So nothing to do with GCC then.

> The following code generates a /dev/shm/shared with -rw-r--r-- access
> privileges, making it inaccessible to others, even though the mode is set to
> rw-rw-rw-:
>
> shmfd = shm_open( shm_name,     // shared memory block with this "/name"
>                   O_CREAT,      // Create if not already there
>                   0666 );       // with these access privileges

It sounds like your process has a umask of 0022.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux