[PATCH] umask in POSIX message queues

From: Krzysztof Benedyczak
Date: Mon Sep 26 2005 - 05:47:40 EST


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 <golbi@xxxxxxxxxxxxxxxx>


--- 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/