From: "Pádraig Brady" <P@draigBrady.com>
To: linux-kernel@vger.kernel.org
Cc: "Pádraig Brady" <P@draigBrady.com>
Subject: [PATCH] symlink: allow an empty target string
Date: Thu, 17 Jan 2013 13:03:53 +0000 [thread overview]
Message-ID: <1358427833-3847-2-git-send-email-P@draigBrady.com> (raw)
In-Reply-To: <1358427833-3847-1-git-send-email-P@draigBrady.com>
POSIX only states that ENOENT should be returned
if an empty string is specified for the link name.
In fact it states the link target...
"shall be treated only as a character string and
shall not be validated as a pathname".
Signed-off-by: Pádraig Brady <P@draigBrady.com>
---
fs/namei.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 43a97ee..26dd264 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3533,12 +3533,13 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
int, newdfd, const char __user *, newname)
{
int error;
+ int empty;
struct filename *from;
struct dentry *dentry;
struct path path;
unsigned int lookup_flags = 0;
- from = getname(oldname);
+ from = getname_flags(oldname, LOOKUP_EMPTY, &empty);
if (IS_ERR(from))
return PTR_ERR(from);
retry:
--
1.7.6.4
next prev parent reply other threads:[~2013-01-17 13:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-17 13:03 RFC: allow empty symlink targets Pádraig Brady
2013-01-17 13:03 ` Pádraig Brady [this message]
2013-01-17 16:22 ` Pádraig Brady
2013-05-15 12:38 ` Pádraig Brady
2013-05-15 14:40 ` Eric Blake
2013-05-15 20:48 ` Pádraig Brady
2013-05-24 10:01 ` Pavel Machek
2013-05-15 22:03 ` Al Viro
2013-05-16 9:37 ` Pádraig Brady
2013-05-16 12:22 ` Eric Blake
2013-05-26 9:39 ` Pavel Machek
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=1358427833-3847-2-git-send-email-P@draigBrady.com \
--to=p@draigbrady.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®