s3:smbd: convert srvstr_pull_req_talloc() into a function
[kai/samba-autobuild/.git] / source3 / smbd / reply.c
index 5fb10d5c54dcee16245abbb329d2403d0cc84aba..274807beb96841700108727650382402f36aa1ea 100644 (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.
 ****************************************************************************/