summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_default.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules/vfs_default.c')
-rw-r--r--source3/modules/vfs_default.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 28adce5768..0e7ba05632 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -214,13 +214,31 @@ static void vfswrap_init_search_op(vfs_handle_struct *handle,
/* File operations */
-static int vfswrap_open(vfs_handle_struct *handle, const char *fname,
- files_struct *fsp, int flags, mode_t mode)
+static int vfswrap_open(vfs_handle_struct *handle,
+ struct smb_filename *smb_fname,
+ files_struct *fsp, int flags, mode_t mode)
{
int result;
+ NTSTATUS status;
+ char *fname = NULL;
START_PROFILE(syscall_open);
+
+ /*
+ * XXX: Should an error be returned if there is a stream rather than
+ * trying to open a filename with a ':'?
+ */
+ status = get_full_smb_filename(talloc_tos(), smb_fname,
+ &fname);
+ if (!NT_STATUS_IS_OK(status)) {
+ errno = map_errno_from_nt_status(status);
+ return -1;
+ }
+
result = sys_open(fname, flags, mode);
+
+ TALLOC_FREE(fname);
+
END_PROFILE(syscall_open);
return result;
}