s3:smbd: convert srvstr_pull_req_talloc() into a function
authorRalph Wuerthner <ralph.wuerthner@de.ibm.com>
Thu, 4 Apr 2013 11:24:36 +0000 (13:24 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 9 Apr 2013 22:13:45 +0000 (00:13 +0200)
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/include/srvstr.h
source3/smbd/proto.h
source3/smbd/reply.c

index 7e7d8a2e92af9463c23ca0d5998259636978884f..2c6e7ef96af15c44d1c00b9a4b4d8eec66290185 100644 (file)
 
 #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)
index 7e13049ff8f387c489ff14346c03f9ccf8ab2a59..2be73a24d8ff51811928d314b6e317162cdfaaeb 100644 (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,
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.
 ****************************************************************************/