]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Ensure get_real_filename() copes with empty pathnames.
authorJeremy Allison <jra@samba.org>
Tue, 21 Aug 2018 19:05:34 +0000 (12:05 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 22 Aug 2018 19:50:41 +0000 (21:50 +0200)
Needed for vfs_glusterfs, as Gluster requires "." not '\0'.

Based on a fix from Anoop C S <anoopcs@redhat.com>

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13585

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Aug 22 21:50:41 CEST 2018 on sn-devel-144

source3/smbd/filename.c

index 9e15af1916d8deeed60595464224fed3eb17541c..41c1710351ea4db2a76f002d51adf344e0cdf430 100644 (file)
@@ -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) {