sys_readlink() with empty filename

From: Will Deacon
Date: Thu Jul 28 2011 - 14:21:42 EST


Hi Al,

In commit 65cfc672 ("readlinkat(), fchownat() and fstatat() with empty
relative pathnames") you changed the behaviour of the readlink syscall so
that LOOKUP_EMPTY is passed in the lookup flags. This causes the syscall to
return -EINVAL rather than -ENOENT if the filename is empty.

Looking at the man page for readlink, it's not obvious to me what the
correct behaviour should be. However, this change has also been noticed by
the gnulib guys because it causes the coreutils tests to fail:

http://comments.gmane.org/gmane.comp.lib.gnulib.bugs/25791

I noticed it as a regression in LTP.

So is this behaviour unspecified by POSIX and are the tests all broken or
should it be fixed in the kernel / C library?

Cheers,

Will
--
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/