[lkml]   [2013]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] symlink: allow an empty target string
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 <>
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);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2013-01-17 14:42    [W:2.940 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site