From owner-freebsd-hackers Sun Dec 25 13:45:02 1994 Return-Path: hackers-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id NAA16857 for hackers-outgoing; Sun, 25 Dec 1994 13:45:02 -0800 Received: from is1.hk.super.net (jbeukema@is1.hk.super.net [202.14.67.232]) by freefall.cdrom.com (8.6.9/8.6.6) with SMTP id VAA16656; Sun, 25 Dec 1994 21:41:53 GMT Received: by is1.hk.super.net id AA29807 (5.67b/IDA-1.5); Mon, 26 Dec 1994 05:41:16 +0800 Date: Mon, 26 Dec 1994 05:41:16 +0800 (HKT) From: John Beukema To: freebsd-hackers@freefall.cdrom.com Cc: FreeBSD-questions Subject: sysv_msg.c bug? Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: hackers-owner@freebsd.org Precedence: bulk I have been having a problem using the SYSV messages facility in 2.0R. The permission bits in msg_perm.mode seem to be ignored and accordingly only the queue owner can write to the queue regardless of the bits. My application uses a database server owned by root but which grants access to ordinary user clients to write to its message queue. As it is now under FBSD, only root can run the client programs. The same program runs all right on SUNOS and SCO. The Sun man pages state, in effect, that any user should be able to write to a queue if its owner (creator) sets msg_perm.mode to 0666. I have examined Daniel Boulet's implementation. (I do not understand (yet) how the functions are transformed from two and three parameters in the declaration to three and four in the implementation.) I noticed msgget masks the requested permission mask, msgflg with & 0700 which, I believe, eliminates the group and other permissions and leaves only the owner bits. msgctl(qid, IPC_STAT) also allows only the queue owner to access queue information. Am I correct, this is a bug? Please reply by mail. jbeukema