mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-03 19:55:31 +00:00
teach filename_lookup() to treat NULL filename as ""
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
9852d85ec9
commit
5b313bcb6e
@ -588,6 +588,7 @@ struct nameidata {
|
||||
unsigned seq;
|
||||
} *stack, internal[EMBEDDED_LEVELS];
|
||||
struct filename *name;
|
||||
const char *pathname;
|
||||
struct nameidata *saved;
|
||||
unsigned root_seq;
|
||||
int dfd;
|
||||
@ -606,6 +607,7 @@ static void __set_nameidata(struct nameidata *p, int dfd, struct filename *name)
|
||||
p->depth = 0;
|
||||
p->dfd = dfd;
|
||||
p->name = name;
|
||||
p->pathname = likely(name) ? name->name : "";
|
||||
p->path.mnt = NULL;
|
||||
p->path.dentry = NULL;
|
||||
p->total_link_count = old ? old->total_link_count : 0;
|
||||
@ -2439,7 +2441,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
|
||||
static const char *path_init(struct nameidata *nd, unsigned flags)
|
||||
{
|
||||
int error;
|
||||
const char *s = nd->name->name;
|
||||
const char *s = nd->pathname;
|
||||
|
||||
/* LOOKUP_CACHED requires RCU, ask caller to retry */
|
||||
if ((flags & (LOOKUP_RCU | LOOKUP_CACHED)) == LOOKUP_CACHED)
|
||||
|
Loading…
Reference in New Issue
Block a user