r3591: to get a bit more useful info from valgrind I'm disabling the
[samba.git] / source4 / libcli / raw / rawrequest.c
index 89155451da1b84be0381e7de206c78fa7520c21c..8d0767b3f53d9fc9c253ce9a2db0b37eaf880510 100644 (file)
 */
 
 #include "includes.h"
+#include "libcli/raw/libcliraw.h"
+#include "dlinklist.h"
 
 /* we over allocate the data buffer to prevent too many realloc calls */
-#define REQ_OVER_ALLOCATION 256
+#define REQ_OVER_ALLOCATION 0
 
 /* assume that a character will not consume more than 3 bytes per char */
 #define MAX_BYTES_PER_CHAR 3
@@ -139,35 +141,17 @@ struct smbcli_request *smbcli_request_setup_transport(struct smbcli_transport *t
   way. This interface is used before a session is setup.
 */
 struct smbcli_request *smbcli_request_setup_session(struct smbcli_session *session,
-                                             uint8_t command, uint_t wct, uint_t buflen)
+                                                   uint8_t command, uint_t wct, uint_t buflen)
 {
        struct smbcli_request *req;
-       uint16_t flags2;
-       uint32_t capabilities;
 
        req = smbcli_request_setup_transport(session->transport, command, wct, buflen);
 
        if (!req) return NULL;
 
        req->session = session;
-       
-       flags2 = FLAGS2_LONG_PATH_COMPONENTS;
-       capabilities = session->transport->negotiate.capabilities;
-
-       if (capabilities & CAP_UNICODE) {
-               flags2 |= FLAGS2_UNICODE_STRINGS;
-       }
-       if (capabilities & CAP_STATUS32) {
-               flags2 |= FLAGS2_32_BIT_ERROR_CODES;
-       }
-       if (capabilities & CAP_EXTENDED_SECURITY) {
-               flags2 |= FLAGS2_EXTENDED_SECURITY;
-       }
-       if (session->transport->negotiate.sign_info.doing_signing) {
-               flags2 |= FLAGS2_SMB_SECURITY_SIGNATURES;
-       }
 
-       SSVAL(req->out.hdr, HDR_FLG2, flags2);
+       SSVAL(req->out.hdr, HDR_FLG2, session->flags2);
        SSVAL(req->out.hdr, HDR_PID, session->pid & 0xFFFF);
        SSVAL(req->out.hdr, HDR_PIDHIGH, session->pid >> 16);
        SSVAL(req->out.hdr, HDR_UID, session->vuid);
@@ -548,7 +532,7 @@ static size_t smbcli_req_pull_ucs2(struct smbcli_request *req, TALLOC_CTX *mem_c
   of bytes consumed in the packet is returned
 */
 size_t smbcli_req_pull_ascii(struct smbcli_request *req, TALLOC_CTX *mem_ctx,
-                         char **dest, const char *src, int byte_len, uint_t flags)
+                            char **dest, const char *src, int byte_len, uint_t flags)
 {
        int src_len, src_len2;
        ssize_t ret;