diff options
author | Tim Prouty <tprouty@samba.org> | 2009-06-10 10:37:57 -0700 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-06-10 13:13:27 -0700 |
commit | a9ec21cf219c3aef0388c252539f315d3e606a71 (patch) | |
tree | 6e0072fabc7d1b33f7c824c850d7a8f3a39dc425 /source3/smbd/trans2.c | |
parent | bddd7ad3dcc4a74fb61e09a2dd6fb7034c820046 (diff) | |
download | samba-a9ec21cf219c3aef0388c252539f315d3e606a71.tar.gz samba-a9ec21cf219c3aef0388c252539f315d3e606a71.tar.xz samba-a9ec21cf219c3aef0388c252539f315d3e606a71.zip |
s3: Prepare the first set of SMB_VFS_CREATE_FILE callers to take an smb_filename struct
Some of the callers required minimal changes, while others
(copy_internals) required significant changes. The task is simplified
a little bit because we are able to do operations and checks on the
base_name when a stream isn't used.
This patch should cause no functional changes.
Volker, Jeremy: Please check
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r-- | source3/smbd/trans2.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index a36e9f588a..dc2544c4e3 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -7208,23 +7208,17 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req, return; } - status = get_full_smb_filename(ctx, smb_dname, &directory); - if (!NT_STATUS_IS_OK(status)) { - reply_nterror(req, status); - return; - } - - status = check_name(conn, directory); + status = check_name(conn, smb_dname->base_name); if (!NT_STATUS_IS_OK(status)) { DEBUG(5,("call_trans2mkdir error (%s)\n", nt_errstr(status))); reply_nterror(req, status); - return; + goto out; } /* Any data in this call is an EA list. */ if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) { reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED); - return; + goto out; } /* @@ -7236,21 +7230,21 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req, if (total_data != 4) { if (total_data < 10) { reply_nterror(req, NT_STATUS_INVALID_PARAMETER); - return; + goto out; } if (IVAL(pdata,0) > total_data) { DEBUG(10,("call_trans2mkdir: bad total data size (%u) > %u\n", IVAL(pdata,0), (unsigned int)total_data)); reply_nterror(req, NT_STATUS_INVALID_PARAMETER); - return; + goto out; } ea_list = read_ea_list(talloc_tos(), pdata + 4, total_data - 4); if (!ea_list) { reply_nterror(req, NT_STATUS_INVALID_PARAMETER); - return; + goto out; } } /* If total_data == 4 Windows doesn't care what values @@ -7258,19 +7252,19 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req, * The System i QNTC IBM SMB client puts bad values here, * so ignore them. */ - status = create_directory(conn, req, directory); + status = create_directory(conn, req, smb_dname); if (!NT_STATUS_IS_OK(status)) { reply_nterror(req, status); - return; + goto out; } /* Try and set any given EA. */ if (ea_list) { - status = set_ea(conn, NULL, directory, ea_list); + status = set_ea(conn, NULL, smb_dname->base_name, ea_list); if (!NT_STATUS_IS_OK(status)) { reply_nterror(req, status); - return; + goto out; } } @@ -7278,7 +7272,7 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req, *pparams = (char *)SMB_REALLOC(*pparams,2); if(*pparams == NULL) { reply_nterror(req, NT_STATUS_NO_MEMORY); - return; + goto out; } params = *pparams; @@ -7286,6 +7280,8 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req, send_trans2_replies(conn, req, params, 2, *ppdata, 0, max_data_bytes); + out: + TALLOC_FREE(smb_dname); return; } |