Fix use of streams modules with CIFSFS client.
authorJeremy Allison <jra@samba.org>
Wed, 25 Feb 2009 21:46:46 +0000 (13:46 -0800)
committerKarolin Seeger <kseeger@samba.org>
Fri, 6 Mar 2009 07:28:26 +0000 (08:28 +0100)
Jeremy.
(cherry picked from commit 0c8b8f2f3483a585d974ce803357f1d9f39e3c9f)

source/modules/vfs_streams_depot.c
source/modules/vfs_streams_xattr.c

index 8ff617cba18250f8391979f44b48a99d751d6393..2a5b7a939e629f9f60287d7390c4ee0061e20964 100644 (file)
@@ -495,7 +495,13 @@ static int streams_depot_unlink(vfs_handle_struct *handle,  const char *fname)
         * We potentially need to delete the per-inode streams directory
         */
 
-       if (SMB_VFS_NEXT_STAT(handle, fname, &sbuf) == -1) {
+       if (lp_posix_pathnames()) {
+               ret = SMB_VFS_NEXT_LSTAT(handle, fname, &sbuf);
+       } else {
+               ret = SMB_VFS_NEXT_STAT(handle, fname, &sbuf);
+       }
+
+       if (ret == -1) {
                return -1;
        }
 
@@ -679,7 +685,11 @@ static NTSTATUS streams_depot_streaminfo(vfs_handle_struct *handle,
                if (is_ntfs_stream_name(fname)) {
                        return NT_STATUS_INVALID_PARAMETER;
                }
-               ret = SMB_VFS_NEXT_STAT(handle, fname, &sbuf);
+               if (lp_posix_pathnames()) {
+                       ret = SMB_VFS_NEXT_LSTAT(handle, fname, &sbuf);
+               } else {
+                       ret = SMB_VFS_NEXT_STAT(handle, fname, &sbuf);
+               }
        }
 
        if (ret == -1) {
index 7124c575203a184fb5936d88274dc2657904b86a..2e203f32ad38d91dc348f4bfa32882f26f9a2d25 100644 (file)
@@ -135,6 +135,7 @@ static bool streams_xattr_recheck(struct stream_io *sio)
 static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp,
                               SMB_STRUCT_STAT *sbuf)
 {
+       int ret = -1;
        struct stream_io *io = (struct stream_io *)
                VFS_FETCH_FSP_EXTENSION(handle, fsp);
 
@@ -148,7 +149,13 @@ static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp,
                return -1;
        }
 
-       if (SMB_VFS_STAT(handle->conn, io->base, sbuf) == -1) {
+       if (lp_posix_pathnames()) {
+               ret = SMB_VFS_LSTAT(handle->conn, io->base, sbuf);
+       } else {
+               ret = SMB_VFS_STAT(handle->conn, io->base, sbuf);
+       }
+
+       if (ret == -1) {
                return -1;
        }
 
@@ -718,7 +725,11 @@ static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
                if (is_ntfs_stream_name(fname)) {
                        return NT_STATUS_INVALID_PARAMETER;
                }
-               ret = SMB_VFS_STAT(handle->conn, fname, &sbuf);
+               if (lp_posix_pathnames()) {
+                       ret = SMB_VFS_LSTAT(handle->conn, fname, &sbuf);
+               } else {
+                       ret = SMB_VFS_STAT(handle->conn, fname, &sbuf);
+               }
        }
 
        if (ret == -1) {