Operating System - HP-UX
1825049 Members
3174 Online
109678 Solutions
New Discussion юеВ

ipcrm -m does not remove shared memory

 
SOLVED
Go to solution
JUP
Regular Advisor

ipcrm -m does not remove shared memory

Hi,

I have the following segments in shared memory, displayed when I do a "ipcs -m"

m 0 0x411c0189 --rw-rw-rw- root root
m 1 0x4e0c0002 --rw-rw-rw- root root
m 2 0x412050fa --rw-rw-rw- root root
m 2031620 0x766d615a --rw-rw-rw- paap dev


The first three (ids: 0, 1 and 2) are system generated. The last one I created in a program and gave it rw permissions to it.

I wish to remove the shared memory under a different user that created it - so I execute:

"/usr/bin/ipcrm -m 2031620"

When I log in as a different user to that that created the shared memory and execute the ipcrm command I get the following:

ipcrm: shmid(2031620): permission denied

I am using HP Itanium, 11.23. I can remove the shared memory on the PA-RISC 11.00 when logged in as a different user.

I would have thought that the -rw-rw-rw would have given all users permissions to delete it.

I can remove the shared memory using ipcrm when logged onto as root or as the owner of the shared memory "paap". But why can't I remove it as a completely different user because its got rw permissions ?


Can anyone please help out here ?

Thanks in advance
JUP
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: ipcrm -m does not remove shared memory

Just as the rw permissions have nothing to do with the removability of a file (that is determined by the permissions of the directory), these permissions have nothing to do with the ability to remove a shmid. The shmid can only be removed by the owner or a user with sufficient privlidges (e.g root). Man shmctl for deatails.
If it ain't broke, I can fix that.
JUP
Regular Advisor

Re: ipcrm -m does not remove shared memory

Thanks - after further investigation I found it only worked on the PA-RISC because of the switch uid command we used.

Thanks again
Nguyen Anh Tien
Honored Contributor

Re: ipcrm -m does not remove shared memory

Some day ago. I encounter with same case. I spent long time to wait and execute ipcrm -m again. (I know rebooting can solve this problem :))) ).
HP is simple