diff options
author | Ralph Wuerthner <ralph.wuerthner@de.ibm.com> | 2013-04-04 13:24:36 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-04-10 00:13:45 +0200 |
commit | a70e9db0f325e9be85983c172f0cc68992b0f593 (patch) | |
tree | fb9eb88a6eff178c813fbf1056dfb82369293ad7 /source3/smbd | |
parent | 98f9e5edd35d6fb54dea74f799b017967b0a13fd (diff) | |
download | samba-a70e9db0f325e9be85983c172f0cc68992b0f593.tar.gz samba-a70e9db0f325e9be85983c172f0cc68992b0f593.tar.bz2 samba-a70e9db0f325e9be85983c172f0cc68992b0f593.zip |
s3:smbd: convert srvstr_pull_req_talloc() into a function
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/proto.h | 2 | ||||
-rw-r--r-- | source3/smbd/reply.c | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 7e13049ff8..2be73a24d8 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -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, diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 5fb10d5c54..274807beb9 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -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. ****************************************************************************/ |