chown()ing message queues and shared mem (was: Who dat?)

Jonathan Hahn hahn at gigantor..nas.nasa.gov
Tue Aug 2 09:22:36 AEST 1988


In article <2310 at rtech.rtech.com> daveb at rtech.com (Dave Brower) writes:
>How can the server find out who the client is, in a spoof-proof and
>secure way?  On BSD, one can have the server ask the client to create a
>randomly-named file, and the server can see who the owner of the file
>is.  On SV, this fails because the client can chown it to be anyone
>else. (The same is true of msgs and shm segments).
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Wait a minute!  I'm not aware that a user can change the creator
uid/gid attributes of a SYSV message queue, semaphore, or shared memory
seg.

You can't use chown() becuase it wants a path into the file system, and
none of those IPC mechanisms has a presence in the file system.  You
can't use {sem,msg,shm}ctl() because, according to the manual pages,
the various SET operations do not affect the cuid or cgid fields for
the creator.

I'm particularly interested in this becuase I plan to have a server use
this mechanism to identify clients via the creator uid of their message
queue.  If there is a way for a client to spoof the cuid/cgid field,
please let me know.

-jonathan hahn
hahn at amelia.nas.nasa.gov
...!ames!amelia!hahn
(415) 694-4360



More information about the Comp.unix.wizards mailing list