]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: vfs_streams_xattr.c: Make streams_xattr_open() store the same path as stream...
authorJeremy Allison <jra@samba.org>
Wed, 1 Feb 2017 19:36:25 +0000 (11:36 -0800)
committerKarolin Seeger <kseeger@samba.org>
Tue, 7 Feb 2017 12:05:34 +0000 (13:05 +0100)
If the open is changing directories, fsp->fsp_name->base_name
will be the full path from the share root, whilst
smb_fname will be relative to the $cwd.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb  2 01:55:42 CET 2017 on sn-devel-144

(cherry picked from commit a24ba3e4083200ec9885363efc5769f43183fb6b)

Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Tue Feb  7 13:05:34 CET 2017 on sn-devel-144

source3/modules/vfs_streams_xattr.c

index b54809f134e50afea074f6a660f42ee35412a9f8..2f77525d7d34dc5e4dd9a11ada75e6d96d7495eb 100644 (file)
@@ -521,8 +521,15 @@ static int streams_xattr_open(vfs_handle_struct *handle,
 
         sio->xattr_name = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
                                        xattr_name);
+       /*
+        * so->base needs to be a copy of fsp->fsp_name->base_name,
+        * making it identical to streams_xattr_recheck(). If the
+        * open is changing directories, fsp->fsp_name->base_name
+        * will be the full path from the share root, whilst
+        * smb_fname will be relative to the $cwd.
+        */
         sio->base = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
-                                 smb_fname->base_name);
+                                 fsp->fsp_name->base_name);
        sio->fsp_name_ptr = fsp->fsp_name;
        sio->handle = handle;
        sio->fsp = fsp;