Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750748AbVIZKpK (ORCPT ); Mon, 26 Sep 2005 06:45:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750770AbVIZKpK (ORCPT ); Mon, 26 Sep 2005 06:45:10 -0400 Received: from leon.mat.uni.torun.pl ([158.75.2.17]:50614 "EHLO Leon.mat.uni.torun.pl") by vger.kernel.org with ESMTP id S1750748AbVIZKpJ (ORCPT ); Mon, 26 Sep 2005 06:45:09 -0400 Date: Mon, 26 Sep 2005 12:44:24 +0200 (CEST) From: Krzysztof Benedyczak X-X-Sender: golbi@Juliusz To: linux-kernel@vger.kernel.org cc: torvalds@osdl.org, Michael Kerrisk , Michal Wronski Subject: [PATCH] umask in POSIX message queues Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1010 Lines: 28 Hi All kernels (form 2.6.6) ignore umask when creating new queues via mq_open (when creating with open() on mqueue fs it is ok of course). According to specification this a bug. The following trivial patch fixes this. It should apply cleanly to any current kernel. Please apply. Signed-off-by: Krzysztof Benedyczak --- linux-2.6.14-rc2/ipc/mqueue.c.orig 2005-09-25 18:52:29.000000000 +0200 +++ linux-2.6.14-rc2/ipc/mqueue.c 2005-09-26 11:44:41.000000000 +0200 @@ -278,6 +278,8 @@ static int mqueue_create(struct inode *d queues_count++; spin_unlock(&mq_lock); + mode &= ~current->fs->umask; + inode = mqueue_get_inode(dir->i_sb, mode, attr); if (!inode) { error = -ENOMEM; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/