]> git.baikalelectronics.ru Git - kernel.git/commit
mknod: take sanity checks on mode into the very beginning
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 19 Jul 2012 21:17:26 +0000 (01:17 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 Jul 2012 17:24:14 +0000 (21:24 +0400)
commit1c364c39552baa1a1fe953651788d3998708a1db
tree0489363abd435b844ffcfb7097b55b616fa908b7
parent4951d52a3194a721344127771c1368bef4b73210
mknod: take sanity checks on mode into the very beginning

Note that applying umask can't affect their results.  While
that affects errno in cases like
mknod("/no_such_directory/a", 030000)
yielding -EINVAL (due to impossible mode_t) instead of
-ENOENT (due to inexistent directory), IMO that makes a lot
more sense, POSIX allows to return either and any software
that relies on getting -ENOENT instead of -EINVAL in that
case deserves everything it gets.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c