From 420477c80eb678f593e8c1b9f785cb94da9f5942 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 21 Aug 2018 12:05:34 -0700 Subject: [PATCH] s3: smbd: Ensure get_real_filename() copes with empty pathnames. Needed for vfs_glusterfs, as Gluster requires "." not '\0'. Based on a fix from Anoop C S BUG: https://bugzilla.samba.org/show_bug.cgi?id=13585 Signed-off-by: Jeremy Allison --- source3/smbd/filename.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 9e15af1916d..41c1710351e 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -1443,6 +1443,11 @@ int get_real_filename(connection_struct *conn, const char *path, int ret; bool mangled; + /* handle null paths */ + if ((path == NULL) || (*path == 0)) { + path = "."; + } + mangled = mangle_is_mangled(name, conn->params); if (mangled) { -- 2.18.0.865.gffc8e1a3cd6-goog