From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
LSM List <linux-security-module@vger.kernel.org>,
Miklos Szeredi <miklos@szeredi.hu>,
David Howells <dhowells@redhat.com>
Subject: Re: [RFC] readlink()-related oddities
Date: Fri, 20 Nov 2015 02:57:49 +0000 [thread overview]
Message-ID: <20151120025749.GJ22011@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+55aFx_=L4adTfn=bZ8oK2b-j-+satDhTsaZUGvcVmJ81A_RQ@mail.gmail.com>
On Thu, Nov 19, 2015 at 06:13:53PM -0800, Linus Torvalds wrote:
> > 3) normally, readlink(2) fails for non-symlinks. Moreover, according to
> > POSIX it should do so (with -EINVAL).
>
> I don't think POSIX is necessarily relevant here.
>
> We have had magic file behavior outside the scope of POSIX before, and
> we will have it in the future. It makes perfect sense to use
> readlink() for management tools for automounting, even if the normal
> oepration is to treat the thing as a directory.
>
> Not everything is within the domain of POSIX.
How would those tools know that this particular pathname _is_ a magical
symlink? Sure, if you see a symlink with body that starts with % or #,
you could figure out that it's not a regular one and go parse the body,
but for stat(2) it looks like a directory. Do those tools call readlink()
on every directory they spot on AFS volume? David?
And what's the story with magical ->open() for those? How could one get
to ->open() on those sucker and avoid triggering the automount instead?
next prev parent reply other threads:[~2015-11-20 2:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 23:26 [RFC] readlink()-related oddities Al Viro
2015-11-20 2:13 ` Linus Torvalds
2015-11-20 2:57 ` Al Viro [this message]
2015-11-20 3:09 ` Linus Torvalds
2015-11-20 3:16 ` Linus Torvalds
2015-11-20 3:24 ` Al Viro
2015-11-20 10:00 ` David Howells
2015-11-20 9:59 ` David Howells
2015-11-20 16:08 ` Al Viro
2015-11-20 16:26 ` David Howells
2015-11-20 22:33 ` Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151120025749.GJ22011@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=dhowells@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).