]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Move srvstr_pull_req_talloc to smb2_reply.c
authorDavid Mulder <dmulder@suse.com>
Thu, 17 Mar 2022 16:45:00 +0000 (10:45 -0600)
committerJeremy Allison <jra@samba.org>
Thu, 7 Apr 2022 17:37:29 +0000 (17:37 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/proto.h
source3/smbd/reply.c
source3/smbd/smb2_reply.c

index 978e98eb1ea54d6eb990042fa8efc0c3f902d5f3..18b738569179f4274ebda5aedfa1912ee15311c3 100644 (file)
@@ -912,8 +912,6 @@ bool disk_quotas(connection_struct *conn, struct smb_filename *fname,
 
 /* The following definitions come from smbd/reply.c  */
 
-size_t srvstr_pull_req_talloc(TALLOC_CTX *ctx, struct smb_request *req,
-                             char **dest, const uint8_t *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,
@@ -1036,6 +1034,8 @@ size_t srvstr_get_path_posix(TALLOC_CTX *ctx,
 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 uint8_t *src, int flags);
 
 /* The following definitions come from smbd/seal.c  */
 
index 2ec4149c2f876290757cba983b557a118c7cbe1a..77816e1883a2fae5289a2225042a326a2e5403ad 100644 (file)
 #include "source3/printing/rap_jobid.h"
 #include "source3/lib/substitute.h"
 
-/**
- * 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 uint8_t *src, int flags)
-{
-       ssize_t bufrem = smbreq_bufrem(req, src);
-
-       if (bufrem < 0) {
-               return 0;
-       }
-
-       return pull_string_talloc(ctx, req->inbuf, req->flags2, dest, src,
-                                 bufrem, flags);
-}
-
 /****************************************************************************
  Check if we have a correct fsp pointing to a file. Basic check for open fsp.
 ****************************************************************************/
index 4048284990eb2be4ed1d1f1f13cd722e844980be..7fa1fb1d265d2005e10002f37894ea0d3cf023c7 100644 (file)
@@ -372,3 +372,21 @@ size_t srvstr_get_path_req(TALLOC_CTX *mem_ctx, struct smb_request *req,
                                err);
        }
 }
+
+/**
+ * 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 uint8_t *src, int flags)
+{
+       ssize_t bufrem = smbreq_bufrem(req, src);
+
+       if (bufrem < 0) {
+               return 0;
+       }
+
+       return pull_string_talloc(ctx, req->inbuf, req->flags2, dest, src,
+                                 bufrem, flags);
+}