]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: Fix O_NOFOLLOW behavior for paths with trailing slashes
authorJan Kara <jack@suse.cz>
Thu, 13 May 2010 10:52:57 +0000 (12:52 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 May 2010 15:46:04 +0000 (08:46 -0700)
commitacf10ddfb28058ce5fcb17acc37c2ced5790cd8e
tree081c54c4a9a266a894a00165e97dabfb212a2470
parented019db20ae136d794f577debb9b123d13ea797d
vfs: Fix O_NOFOLLOW behavior for paths with trailing slashes

According to specification

mkdir d; ln -s d a; open("a/", O_NOFOLLOW | O_RDONLY)

should return success but currently it returns ELOOP.  This is a
regression caused by path lookup cleanup patch series.

Fix the code to ignore O_NOFOLLOW in case the provided path has trailing
slashes.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: Marius Tolzmann <tolzmann@molgen.mpg.de>
Acked-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/namei.c