The branch, master has been updated
       via  ed6fa37... Treat an open of stream ::$DATA as an open of the base 
file. This fixes a class of SMB_ASSERT failures when doing stream tests.
      from  6427484... s3:build: build smbtorture4 when the merged build is 
selected

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ed6fa379ef6e1f5d7ca3d5c42e4e97a2c7604683
Author: Jeremy Allison <j...@samba.org>
Date:   Thu May 13 10:54:15 2010 -0700

    Treat an open of stream ::$DATA as an open of the base file.
    This fixes a class of SMB_ASSERT failures when doing stream tests.
    
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/onefs_open.c |   27 +++++++++++++++++++++++++++
 source3/smbd/open.c          |   24 +++++++++++++++++++++++-
 2 files changed, 50 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index dd4c245..f7d6e07 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -2106,6 +2106,33 @@ NTSTATUS onefs_create_file(vfs_handle_struct *handle,
                goto fail;
        }
 
+       if (is_ntfs_stream_smb_fname(smb_fname)) {
+               if (!(conn->fs_capabilities & FILE_NAMED_STREAMS)) {
+                       status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
+                       goto fail;
+               }
+
+               if (is_ntfs_default_stream_smb_fname(smb_fname)) {
+                       int ret;
+                       smb_fname->stream_name = NULL;
+                       /* We have to handle this error here. */
+                       if (create_options & FILE_DIRECTORY_FILE) {
+                               status = NT_STATUS_NOT_A_DIRECTORY;
+                               goto fail;
+                       }
+                       if (lp_posix_pathnames()) {
+                               ret = SMB_VFS_LSTAT(conn, smb_fname);
+                       } else {
+                               ret = SMB_VFS_STAT(conn, smb_fname);
+                       }
+
+                       if (ret == 0 && VALID_STAT_OF_DIR(smb_fname->st)) {
+                               status = NT_STATUS_FILE_IS_A_DIRECTORY;
+                               goto fail;
+                       }
+               }
+       }
+
        status = onefs_create_file_unixpath(
                conn,                                   /* conn */
                req,                                    /* req */
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 62651b0..049ce22 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3419,6 +3419,7 @@ NTSTATUS create_file_default(connection_struct *conn,
        int info = FILE_WAS_OPENED;
        files_struct *fsp = NULL;
        NTSTATUS status;
+       bool stream_name = false;
 
        DEBUG(10,("create_file: access_mask = 0x%x "
                  "file_attributes = 0x%x, share_access = 0x%x, "
@@ -3453,7 +3454,8 @@ NTSTATUS create_file_default(connection_struct *conn,
         * Check to see if this is a mac fork of some kind.
         */
 
-       if (is_ntfs_stream_smb_fname(smb_fname)) {
+       stream_name = is_ntfs_stream_smb_fname(smb_fname);
+       if (stream_name) {
                enum FAKE_FILE_TYPE fake_file_type;
 
                fake_file_type = is_fake_file(smb_fname);
@@ -3495,6 +3497,26 @@ NTSTATUS create_file_default(connection_struct *conn,
                goto fail;
        }
 
+       if (stream_name && is_ntfs_default_stream_smb_fname(smb_fname)) {
+               int ret;
+               smb_fname->stream_name = NULL;
+               /* We have to handle this error here. */
+               if (create_options & FILE_DIRECTORY_FILE) {
+                       status = NT_STATUS_NOT_A_DIRECTORY;
+                       goto fail;
+               }
+               if (lp_posix_pathnames()) {
+                       ret = SMB_VFS_LSTAT(conn, smb_fname);
+               } else {
+                       ret = SMB_VFS_STAT(conn, smb_fname);
+               }
+
+               if (ret == 0 && VALID_STAT_OF_DIR(smb_fname->st)) {
+                       status = NT_STATUS_FILE_IS_A_DIRECTORY;
+                       goto fail;
+               }
+       }
+
        status = create_file_unixpath(
                conn, req, smb_fname, access_mask, share_access,
                create_disposition, create_options, file_attributes,


-- 
Samba Shared Repository

Reply via email to