1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

s3:smbd: convert srvstr_pull_req_talloc() into a function

Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Ralph Wuerthner 2013-04-04 13:24:36 +02:00 committed by Michael Adam
parent 98f9e5edd3
commit a70e9db0f3
3 changed files with 14 additions and 9 deletions

View File

@ -19,12 +19,3 @@
#define srvstr_pull_talloc(ctx, base_ptr, smb_flags2, dest, src, src_len, flags) \
pull_string_talloc(ctx, base_ptr, smb_flags2, dest, src, src_len, flags)
/* pull a string from the smb_buf part of a packet. In this case the
string can either be null terminated or it can be terminated by the
end of the smbbuf area
*/
#define srvstr_pull_req_talloc(ctx, req_, dest, src, flags) \
pull_string_talloc(ctx, req_->inbuf, req_->flags2, dest, src, \
smbreq_bufrem(req_, src), flags)

View File

@ -841,6 +841,8 @@ size_t srvstr_get_path_req_wcard(TALLOC_CTX *mem_ctx, struct smb_request *req,
size_t srvstr_get_path_req(TALLOC_CTX *mem_ctx, struct smb_request *req,
char **pp_dest, const char *src, int flags,
NTSTATUS *err);
size_t srvstr_pull_req_talloc(TALLOC_CTX *ctx, struct smb_request *req,
char **dest, const char *src, int flags);
bool check_fsp_open(connection_struct *conn, struct smb_request *req,
files_struct *fsp);
bool check_fsp(connection_struct *conn, struct smb_request *req,

View File

@ -339,6 +339,18 @@ size_t srvstr_get_path_req(TALLOC_CTX *mem_ctx, struct smb_request *req,
flags, err, &ignore);
}
/**
* pull a string from the smb_buf part of a packet. In this case the
* string can either be null terminated or it can be terminated by the
* end of the smbbuf area
*/
size_t srvstr_pull_req_talloc(TALLOC_CTX *ctx, struct smb_request *req,
char **dest, const char *src, int flags)
{
return pull_string_talloc(ctx, req->inbuf, req->flags2, dest, src,
smbreq_bufrem(req, src), flags);
}
/****************************************************************************
Check if we have a correct fsp pointing to a file. Basic check for open fsp.
****************************************************************************/