s3: Update streaminfo implementations now that only base names are passed through...
authorTim Prouty <tprouty@samba.org>
Mon, 6 Jul 2009 22:26:57 +0000 (15:26 -0700)
committerTim Prouty <tprouty@samba.org>
Mon, 6 Jul 2009 22:38:47 +0000 (15:38 -0700)
source3/modules/onefs_streams.c
source3/modules/vfs_default.c
source3/modules/vfs_streams_depot.c
source3/modules/vfs_streams_xattr.c

index 2be490f52d0b60d4f74f781d08b4e01f5a09ceb1..91917eef44de395a15c06aa94d371f98e624fc5c 100644 (file)
@@ -739,17 +739,10 @@ NTSTATUS onefs_streaminfo(vfs_handle_struct *handle,
 
        /* Get a valid stat. */
        if ((fsp != NULL) && (fsp->fh->fd != -1)) {
-               if (is_ntfs_stream_name(fsp->fsp_name)) {
-                       return NT_STATUS_INVALID_PARAMETER;
-               }
                ret = SMB_VFS_FSTAT(fsp, &sbuf);
        } else {
                struct smb_filename *smb_fname = NULL;
 
-               if (is_ntfs_stream_name(fname)) {
-                       return NT_STATUS_INVALID_PARAMETER;
-               }
-
                status = create_synthetic_smb_fname(talloc_tos(), fname, NULL,
                                                    NULL, &smb_fname);
                if (!NT_STATUS_IS_OK(status)) {
index 7565e7bb65fb0cd5fa5f19968aa930b7e386eee3..c4db8fa393f6ed6209b44fc0de58a5dabee65456 100644 (file)
@@ -1151,7 +1151,17 @@ static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle,
                ret = SMB_VFS_FSTAT(fsp, &sbuf);
        }
        else {
-               ret = vfs_stat_smb_fname(handle->conn, fname, &sbuf);
+               struct smb_filename *smb_fname = NULL;
+               NTSTATUS status;
+
+               status = create_synthetic_smb_fname(talloc_tos(), fname, NULL,
+                                                   NULL, &smb_fname);
+               if (!NT_STATUS_IS_OK(status)) {
+                       return status;
+               }
+               ret = SMB_VFS_STAT(handle->conn, smb_fname);
+               sbuf = smb_fname->st;
+               TALLOC_FREE(smb_fname);
        }
 
        if (ret == -1) {
index dca18e09539170062488a952b025cad0ecbad9d3..ba3b180244082753f5c058b67b1c089044dfd68d 100644 (file)
@@ -819,15 +819,9 @@ static NTSTATUS streams_depot_streaminfo(vfs_handle_struct *handle,
        }
 
        if ((fsp != NULL) && (fsp->fh->fd != -1)) {
-               if (is_ntfs_stream_name(fsp->fsp_name)) {
-                       return NT_STATUS_INVALID_PARAMETER;
-               }
                ret = SMB_VFS_NEXT_FSTAT(handle, fsp, &smb_fname_base->st);
        }
        else {
-               if (is_ntfs_stream_name(fname)) {
-                       return NT_STATUS_INVALID_PARAMETER;
-               }
                if (lp_posix_pathnames()) {
                        ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname_base);
                } else {
index 6137d01159b0130a53b6778471e7cfe5be254bbe..74b14ff93f534ac6a7ea822f00dc5ae8e54f9321 100644 (file)
@@ -785,20 +785,22 @@ static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
        struct streaminfo_state state;
 
        if ((fsp != NULL) && (fsp->fh->fd != -1)) {
-               if (is_ntfs_stream_name(fsp->fsp_name)) {
-                       return NT_STATUS_INVALID_PARAMETER;
-               }
                ret = SMB_VFS_FSTAT(fsp, &sbuf);
        }
        else {
-               if (is_ntfs_stream_name(fname)) {
-                       return NT_STATUS_INVALID_PARAMETER;
+               struct smb_filename *smb_fname = NULL;
+               status = create_synthetic_smb_fname(talloc_tos(), fname, NULL,
+                                                   NULL, &smb_fname);
+               if (!NT_STATUS_IS_OK(status)) {
+                       return status;
                }
                if (lp_posix_pathnames()) {
-                       ret = vfs_lstat_smb_fname(handle->conn, fname, &sbuf);
+                       ret = SMB_VFS_LSTAT(handle->conn, smb_fname);
                } else {
-                       ret = vfs_stat_smb_fname(handle->conn, fname, &sbuf);
+                       ret = SMB_VFS_STAT(handle->conn, smb_fname);
                }
+               sbuf = smb_fname->st;
+               TALLOC_FREE(smb_fname);
        }
 
        if (ret == -1) {