Re: [PATCH] umask in POSIX message queues

From: Krzysztof Benedyczak
Date: Tue Sep 27 2005 - 06:14:05 EST


On Mon, 26 Sep 2005, Linus Torvalds wrote:

> As far as I can tell, the VFS layer should have done this for us already,
> with code like
>
> ...
> if (!IS_POSIXACL(dir->d_inode))
> mode &= ~current->fs->umask;
> error = vfs_create(dir->d_inode, path.dentry, mode, nd);
> ...
>
> in fs/namei.c (open_namei()).
>
> Which path did you come through that didn't do this? That would be the
> real bug, I suspect..

As I noted when creating mqueues with sys_open() the umask is set
correctly just by the code you pointed out. But sys_mq_open() doesn't use
open_namei() nor filp_open(); the reason is extra data - mq_attr - that
must be passed to real mqueue creating code. So the invocation path is:
sys_mq_open() -> do_create() -> vfs_create() -> (vfs create handler)
mqueue_create().

After rereading it I think that the better place for the line setting
umask is do_create() function as it will be on the same level as
open_namei(). I hope this change will clarify things.

If this make sense I'll send a patch.

Best regards
Krzysiek
-
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/