Re: sys_readlink() with empty filename

From: Will Deacon
Date: Tue Aug 02 2011 - 11:47:55 EST


On Thu, Jul 28, 2011 at 07:21:29PM +0100, Will Deacon wrote:
> 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?

Any comments on this? I'm reluctant to start changing tests if this is just
an oversight in the kernel.

Thanks,

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/