[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Wed Feb 23 20:18:01 MST 2011
The branch, master has been updated
via 9e93dac Remember to free the second temporary string.
via 916e828 Fix bug 7950 - Samba 3.5.x fails BASE-CREATEX_SHAREMODES_DIR smbtorture4 test We need to revalidate the pathname once re-constructed from a root fsp.
from 5ec284d build: moved librpc/rpc/*.c into a rpccommon library
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 9e93dacfc6020deab9f15353ae32512a58e7b4b8
Author: Jeremy Allison <jra at samba.org>
Date: Wed Feb 23 18:32:35 2011 -0800
Remember to free the second temporary string.
Autobuild-User: Jeremy Allison <jra at samba.org>
Autobuild-Date: Thu Feb 24 04:17:49 CET 2011 on sn-devel-104
commit 916e82823b56a70d7761644b38a250ea8c38e204
Author: Jeremy Allison <jra at samba.org>
Date: Wed Feb 23 18:24:41 2011 -0800
Fix bug 7950 - Samba 3.5.x fails BASE-CREATEX_SHAREMODES_DIR smbtorture4 test
We need to revalidate the pathname once re-constructed from a root fsp.
Jeremy.
-----------------------------------------------------------------------
Summary of changes:
source3/include/proto.h | 3 ++-
source3/modules/onefs_open.c | 4 +++-
source3/smbd/open.c | 23 +++++++++++++++++------
3 files changed, 22 insertions(+), 8 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/include/proto.h b/source3/include/proto.h
index c2385c9..fe4a2c1 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4890,7 +4890,8 @@ NTSTATUS create_file_default(connection_struct *conn,
NTSTATUS get_relative_fid_filename(connection_struct *conn,
struct smb_request *req,
uint16_t root_dir_fid,
- struct smb_filename *smb_fname);
+ const struct smb_filename *smb_fname,
+ struct smb_filename **smb_fname_out);
/* The following definitions come from smbd/oplock.c */
diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index fb4b89a..c9372e5 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -2093,11 +2093,13 @@ NTSTATUS onefs_create_file(vfs_handle_struct *handle,
/* Get the file name if root_dir_fid was specified. */
if (root_dir_fid != 0) {
+ struct smb_filename *smb_fname_out = NULL;
status = get_relative_fid_filename(conn, req, root_dir_fid,
- smb_fname);
+ smb_fname, &smb_fname_out);
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
+ smb_fname = smb_fname_out;
}
/* All file access must go through check_name() */
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 2c7764a..cd3fb06 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3431,7 +3431,8 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
NTSTATUS get_relative_fid_filename(connection_struct *conn,
struct smb_request *req,
uint16_t root_dir_fid,
- struct smb_filename *smb_fname)
+ const struct smb_filename *smb_fname,
+ struct smb_filename **smb_fname_out)
{
files_struct *dir_fsp;
char *parent_fname = NULL;
@@ -3519,19 +3520,27 @@ NTSTATUS get_relative_fid_filename(connection_struct *conn,
}
}
- new_base_name = talloc_asprintf(smb_fname, "%s%s", parent_fname,
+ new_base_name = talloc_asprintf(talloc_tos(), "%s%s", parent_fname,
smb_fname->base_name);
if (new_base_name == NULL) {
status = NT_STATUS_NO_MEMORY;
goto out;
}
- TALLOC_FREE(smb_fname->base_name);
- smb_fname->base_name = new_base_name;
- status = NT_STATUS_OK;
+ status = filename_convert(req,
+ conn,
+ req->flags2 & FLAGS2_DFS_PATHNAMES,
+ new_base_name,
+ 0,
+ NULL,
+ smb_fname_out);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto out;
+ }
out:
TALLOC_FREE(parent_fname);
+ TALLOC_FREE(new_base_name);
return status;
}
@@ -3579,11 +3588,13 @@ NTSTATUS create_file_default(connection_struct *conn,
*/
if (root_dir_fid != 0) {
+ struct smb_filename *smb_fname_out = NULL;
status = get_relative_fid_filename(conn, req, root_dir_fid,
- smb_fname);
+ smb_fname, &smb_fname_out);
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
+ smb_fname = smb_fname_out;
}
/*
--
Samba Shared Repository
More information about the samba-cvs
mailing list