From 2bd5ac86ffc9f7610b0205092e4cc9cdccb4752f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 2 Nov 2008 00:59:03 +0100 Subject: Add srvstr_get_path_req[_wcard] --- source3/include/proto.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c78c0a0fa7..441ab2cf29 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -8266,6 +8266,12 @@ size_t srvstr_get_path(TALLOC_CTX *ctx, size_t src_len, int flags, NTSTATUS *err); +size_t srvstr_get_path_req_wcard(TALLOC_CTX *mem_ctx, struct smb_request *req, + char **pp_dest, const char *src, int flags, + NTSTATUS *err, bool *contains_wcard); +size_t srvstr_get_path_req(TALLOC_CTX *mem_ctx, struct smb_request *req, + char **pp_dest, const char *src, int flags, + NTSTATUS *err); bool check_fsp_open(connection_struct *conn, struct smb_request *req, files_struct *fsp); bool check_fsp(connection_struct *conn, struct smb_request *req, -- cgit From a31fab81568ed2b4314ea05740423aceb5d7c977 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 2 Nov 2008 01:07:46 +0100 Subject: Simplify params of srvstr_pull_buf_talloc() Now that "req" is available everywhere, use it. Rename srvstr_pull_buf_talloc() to srvstr_pull_req() --- source3/include/srvstr.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/srvstr.h b/source3/include/srvstr.h index 0e8e275655..d2de6805d3 100644 --- a/source3/include/srvstr.h +++ b/source3/include/srvstr.h @@ -25,5 +25,6 @@ end of the smbbuf area */ -#define srvstr_pull_buf_talloc(ctx, inbuf, smb_flags2, dest, src, flags) \ - pull_string_talloc(ctx, inbuf, smb_flags2, dest, src, smb_bufrem(inbuf, src), flags) +#define srvstr_pull_req_talloc(ctx, req_, dest, src, flags) \ + pull_string_talloc(ctx, req_->inbuf, req_->flags2, dest, src, \ + smb_bufrem(req_->inbuf, src), flags) -- cgit From af7cf4f992d8bb3b6677c094c85b9b1055a6ffc9 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 2 Nov 2008 01:21:53 +0100 Subject: Remove some direct inbuf references by adding smbreq_bufrem --- source3/include/smb_macros.h | 2 ++ source3/include/srvstr.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 89d8994eaf..46ca236553 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -131,6 +131,8 @@ /* the remaining number of bytes in smb buffer 'buf' from pointer 'p'. */ #define smb_bufrem(buf, p) (smb_buflen(buf)-PTR_DIFF(p, smb_buf(buf))) +#define smbreq_bufrem(req, p) (req->buflen - PTR_DIFF(p, req->buf)) + /* Note that chain_size must be available as an extern int to this macro. */ #define smb_offset(p,buf) (PTR_DIFF(p,buf+4) + chain_size) diff --git a/source3/include/srvstr.h b/source3/include/srvstr.h index d2de6805d3..7e7d8a2e92 100644 --- a/source3/include/srvstr.h +++ b/source3/include/srvstr.h @@ -27,4 +27,4 @@ #define srvstr_pull_req_talloc(ctx, req_, dest, src, flags) \ pull_string_talloc(ctx, req_->inbuf, req_->flags2, dest, src, \ - smb_bufrem(req_->inbuf, src), flags) + smbreq_bufrem(req_, src), flags) -- cgit From 2bab73a18d22284c68fefb091c3c6869898ef576 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 2 Nov 2008 12:20:47 +0100 Subject: Remove a bunch of direct inbuf references by adding "vwv" to smb_request --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index e2cd0e571c..3de782e8b8 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -631,6 +631,7 @@ struct smb_request { uint16 vuid; uint16 tid; uint8 wct; + uint16_t *vwv; uint16_t buflen; const uint8_t *buf; const uint8 *inbuf; -- cgit From c2a280ac630a41221cff6e72ceda8661c3b78d83 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 2 Nov 2008 21:24:28 +0100 Subject: Pass smb_request to send_trans_reply to match with send_[nt]trans[2]_reply --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 441ab2cf29..5ca5c7766f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -7869,7 +7869,7 @@ NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *fsp, /* The following definitions come from smbd/ipc.c */ void send_trans_reply(connection_struct *conn, - const uint8_t *inbuf, + struct smb_request *req, char *rparam, int rparam_len, char *rdata, int rdata_len, bool buffer_too_large); -- cgit From 7808a2594c22ff452d54d2e9e272aa60e4b7e482 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 2 Nov 2008 22:33:20 +0100 Subject: Remove some inbuf references by adding "cmd" to smb_request --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 3de782e8b8..bcf605ee53 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -625,6 +625,7 @@ struct current_user { }; struct smb_request { + uint8_t cmd; uint16 flags2; uint16 smbpid; uint16 mid; -- cgit