From 4e3656b8d1d0bf8c0c4ade01332e7384ea890810 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Tue, 16 Jun 2009 12:01:13 -0700 Subject: s3: Change SMB_VFS_OPEN to take an smb_filename struct This was a little messy because of all of the vfs modules I had to touch. Most of them were pretty straight forward, but the streams modules required a little attention to handle smb_filename. Since the use of smb_filename enables the vfs modules to access the raw, over-the-wire stream, a little bit of the handling that was being done by split_ntfs_stream_name has now been shifted into the individual stream modules. It may be a little more code, but overall it gives more flexibility to the streams modules, while also allowing correct stream handling. --- source3/torture/cmd_vfs.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source3/torture') diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 1664f9a94d..f1f4aed77c 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -236,6 +236,8 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c mode_t mode; const char *flagstr; files_struct *fsp; + struct smb_filename *smb_fname = NULL; + NTSTATUS status; mode = 00400; @@ -328,7 +330,16 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c } fsp->conn = vfs->conn; - fsp->fh->fd = SMB_VFS_OPEN(vfs->conn, argv[1], fsp, flags, mode); + status = create_synthetic_smb_fname_split(mem_ctx, argv[1], NULL, + &smb_fname); + if (!NT_STATUS_IS_OK(status)) { + SAFE_FREE(fsp->fsp_name); + SAFE_FREE(fsp); + return status; + } + + fsp->fh->fd = SMB_VFS_OPEN(vfs->conn, smb_fname, fsp, flags, mode); + TALLOC_FREE(smb_fname); if (fsp->fh->fd == -1) { printf("open: error=%d (%s)\n", errno, strerror(errno)); SAFE_FREE(fsp->fh); -- cgit