From dd112643c0db33ec0ea288788c02e20d26c2be40 Mon Sep 17 00:00:00 2001 From: Robert Karszniewicz Date: Wed, 18 Sep 2019 13:47:49 +0200 Subject: chdir(): add LOOKUP_DIRECTORY flag to filename_lookup() This makes sure that automount points get handled even if the path doesn't end with a '/'. Signed-off-by: Robert Karszniewicz Signed-off-by: Sascha Hauer --- fs/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fs.c b/fs/fs.c index dda19db913..12faaebc27 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -2699,7 +2699,7 @@ int chdir(const char *pathname) struct path path; int ret; - ret = filename_lookup(AT_FDCWD, getname(pathname), LOOKUP_FOLLOW, &path); + ret = filename_lookup(AT_FDCWD, getname(pathname), LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path); if (ret) goto out; -- cgit v1.2.3