[PATCH] Make POSIX message queue sys_mq_open() honor umask
authorKrzysztof Benedyczak <golbi@mat.uni.torun.pl>
Tue, 27 Sep 2005 20:21:36 +0000 (22:21 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 27 Sep 2005 20:30:45 +0000 (13:30 -0700)
We ignored umask when creating new queues via mq_open (when creating
with open() on mqueue fs it is ok of course).  According to the
specification this a bug.  This trivial patch fixes this.

Signed-off-by: Krzysztof Benedyczak <golbi@mat.uni.torun.pl>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
ipc/mqueue.c

index 3a926011507b8768ff9991b55837a3f7ee9f579e..a0f18c9cc89df5983b16afc41c610e66391f5a0b 100644 (file)
@@ -611,6 +611,7 @@ static struct file *do_create(struct dentry *dir, struct dentry *dentry,
                dentry->d_fsdata = &attr;
        }
 
+       mode &= ~current->fs->umask;
        ret = vfs_create(dir->d_inode, dentry, mode, NULL);
        dentry->d_fsdata = NULL;
        if (ret)