summaryrefslogtreecommitdiff
path: root/source3/modules/onefs_open.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-07-10 18:11:32 -0700
committerTim Prouty <tprouty@samba.org>2009-07-20 17:26:57 -0700
commitc9b8a017147211d86662f40dcf835b152ab90cf4 (patch)
tree8b234318da33165a45422b4a09cb5fd3dacd2507 /source3/modules/onefs_open.c
parent5a8d70d465f28ae02f4df7a3c2905e028c2e3142 (diff)
downloadsamba-c9b8a017147211d86662f40dcf835b152ab90cf4.tar.gz
samba-c9b8a017147211d86662f40dcf835b152ab90cf4.tar.bz2
samba-c9b8a017147211d86662f40dcf835b152ab90cf4.zip
s3: Finish plumbing the fsp->fsp_name smb_fname conversion through the modules.
Diffstat (limited to 'source3/modules/onefs_open.c')
-rw-r--r--source3/modules/onefs_open.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index b51d516956..31f27e907a 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -81,7 +81,6 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
struct security_descriptor *sd,
int *granted_oplock)
{
- char *path = NULL;
struct smb_filename *smb_fname_onefs = NULL;
NTSTATUS status = NT_STATUS_OK;
int accmode = (flags & O_ACCMODE);
@@ -157,7 +156,7 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
* wildcard characters are allowed in stream names
* only test the basefilename
*/
- wild = fsp->base_fsp->fsp_name;
+ wild = fsp->base_fsp->fsp_name->base_name;
} else {
wild = smb_fname->base_name;
}
@@ -323,15 +322,13 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
fsp->aio_write_behind = True;
}
- status = get_full_smb_filename(talloc_tos(), smb_fname,
- &path);
+ status = fsp_set_smb_fname(fsp, smb_fname);
if (!NT_STATUS_IS_OK(status)) {
+ fd_close(fsp);
+ errno = map_errno_from_nt_status(status);
return status;
}
- string_set(&fsp->fsp_name, path);
- TALLOC_FREE(path);
-
fsp->wcp = NULL; /* Write cache pointer. */
DEBUG(2,("%s opened file %s read=%s write=%s (numopen=%d)\n",
@@ -1592,7 +1589,12 @@ static NTSTATUS onefs_open_directory(connection_struct *conn,
fsp->is_directory = True;
fsp->posix_open = posix_open;
- string_set(&fsp->fsp_name, smb_dname->base_name);
+ status = fsp_set_smb_fname(fsp, smb_dname);
+ if (!NT_STATUS_IS_OK(status)) {
+ fd_close(fsp);
+ file_free(req, fsp);
+ return status;
+ }
mtimespec = smb_dname->st.st_ex_mtime;