
Ion GaztaƱaga wrote:
One thing about shmem concerns me greatly. AFAIK shared memory is accessed by a string handle. What then, when using open _or_create, is to stop two totally unrelated applications accessing the same shared memory area by accident, or malice because they used the same string handle?
There is no way to stop this. Is the same as if two unrelated processes open and write the same file. What can you do to stop this?
Not much. Security attributes can restrict access to specific users or specific groups, but if the offending process has the same security status as the legitimate one, there's no way to stop the access. The best you can do to prevent accidental access is to use unique prefixes for the name, similar to Java packages or XML namespace, e.g. a domain you control. Then you just need to make sure that your company doesn't produce two unrelated applications that use the same name, but that ought to be manageable. But as far as malicious interference goes, all IPC methods are rather weak in my experience: named pipes, message queues, Win32 messages, global named synchronization objects, they all suffer from the same problem. Sebastian Redl