summaryrefslogtreecommitdiffstats
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.c58
1 files changed, 18 insertions, 40 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index d6a66b01de5..cdfd28c5711 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -218,27 +218,17 @@ 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;
+ int result = -1;
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;
+ if (smb_fname->stream_name) {
+ errno = ENOENT;
+ goto out;
}
- result = sys_open(fname, flags, mode);
-
- TALLOC_FREE(fname);
-
+ result = sys_open(smb_fname->base_name, flags, mode);
+ out:
END_PROFILE(syscall_open);
return result;
}
@@ -562,23 +552,17 @@ static int vfswrap_fsync(vfs_handle_struct *handle, files_struct *fsp)
static int vfswrap_stat(vfs_handle_struct *handle,
struct smb_filename *smb_fname)
{
- int result;
- NTSTATUS status;
- char *fname = NULL;
+ int result = -1;
START_PROFILE(syscall_stat);
- 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;
+ if (smb_fname->stream_name) {
+ errno = ENOENT;
+ goto out;
}
- result = sys_stat(fname, &smb_fname->st);
-
- TALLOC_FREE(fname);
-
+ result = sys_stat(smb_fname->base_name, &smb_fname->st);
+ out:
END_PROFILE(syscall_stat);
return result;
}
@@ -596,23 +580,17 @@ static int vfswrap_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUC
static int vfswrap_lstat(vfs_handle_struct *handle,
struct smb_filename *smb_fname)
{
- int result;
- NTSTATUS status;
- char *fname = NULL;
+ int result = -1;
START_PROFILE(syscall_lstat);
- 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;
+ if (smb_fname->stream_name) {
+ errno = ENOENT;
+ goto out;
}
- result = sys_lstat(fname, &smb_fname->st);
-
- TALLOC_FREE(fname);
-
+ result = sys_lstat(smb_fname->base_name, &smb_fname->st);
+ out:
END_PROFILE(syscall_lstat);
return result;
}