summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_default.c
diff options
context:
space:
mode:
authorJohn H Terpstra <jht@samba.org>2009-07-23 09:33:06 -0500
committerJohn H Terpstra <jht@samba.org>2009-07-23 09:33:06 -0500
commit94717ae8e5dfe2ccdb7f3557d5490708b00ae471 (patch)
treea39f669faf23ad05497963cf5ccf611467d0145b /source3/modules/vfs_default.c
parent14952c72a29ec92badb1bcf16d2a15fe100f060d (diff)
parent7bad4b48c82fed4263c2bfe97a4d00b47913604a (diff)
downloadsamba-94717ae8e5dfe2ccdb7f3557d5490708b00ae471.tar.gz
samba-94717ae8e5dfe2ccdb7f3557d5490708b00ae471.tar.bz2
samba-94717ae8e5dfe2ccdb7f3557d5490708b00ae471.zip
Merge branch 'master' of ssh://jht@git.samba.org/data/git/samba
Diffstat (limited to 'source3/modules/vfs_default.c')
-rw-r--r--source3/modules/vfs_default.c67
1 files changed, 24 insertions, 43 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index c4db8fa393..cdfd28c571 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;
}
@@ -866,7 +844,9 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
uint64_t space_avail;
uint64_t bsize,dfree,dsize;
- space_avail = get_dfree_info(fsp->conn,fsp->fsp_name,false,&bsize,&dfree,&dsize);
+ space_avail = get_dfree_info(fsp->conn,
+ fsp->fsp_name->base_name, false,
+ &bsize, &dfree, &dsize);
/* space_avail is 1k blocks */
if (space_avail == (uint64_t)-1 ||
((uint64_t)space_to_write/1024 > space_avail) ) {
@@ -1102,7 +1082,8 @@ static NTSTATUS vfswrap_notify_watch(vfs_handle_struct *vfs_handle,
return NT_STATUS_OK;
}
-static int vfswrap_chflags(vfs_handle_struct *handle, const char *path, int flags)
+static int vfswrap_chflags(vfs_handle_struct *handle, const char *path,
+ unsigned int flags)
{
#ifdef HAVE_CHFLAGS
return chflags(path, flags);
@@ -1113,7 +1094,7 @@ static int vfswrap_chflags(vfs_handle_struct *handle, const char *path, int flag
}
static struct file_id vfswrap_file_id_create(struct vfs_handle_struct *handle,
- SMB_STRUCT_STAT *sbuf)
+ const SMB_STRUCT_STAT *sbuf)
{
struct file_id key;