summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/byteorder.h15
-rw-r--r--source3/pipentlsa.c6
-rw-r--r--source3/pipeutil.c4
-rw-r--r--source3/smbparse.c6
4 files changed, 20 insertions, 11 deletions
diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h
index 06337b91a2..e11771c3ab 100644
--- a/source3/include/byteorder.h
+++ b/source3/include/byteorder.h
@@ -94,6 +94,10 @@ it also defines lots of intermediate macros, just ignore those :-)
if (read) { PCVAL (inbuf,0,outbuf,len) } \
else { PSCVAL(inbuf,0,outbuf,len) }
+#define RW_PIVAL(read,inbuf,outbuf,len) \
+ if (read) { PIVAL (inbuf,0,outbuf,len) } \
+ else { PSIVAL(inbuf,0,outbuf,len) }
+
#define RW_PSVAL(read,inbuf,outbuf,len) \
if (read) { PSVAL (inbuf,0,outbuf,len) } \
else { PSSVAL(inbuf,0,outbuf,len) }
@@ -202,14 +206,21 @@ it also defines lots of intermediate macros, just ignore those :-)
RW_PCVAL(read,inbuf,outbuf,len) \
DEBUG(5,("%s%04x %s: ", \
tab_depth(depth), PTR_DIFF(inbuf,base),string)); \
- { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%x ", (outbuf)[idx])); } } \
+ { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (outbuf)[idx])); } } \
DEBUG(5,("\n"));
#define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \
RW_PSVAL(read,inbuf,outbuf,len) \
DEBUG(5,("%s%04x %s: ", \
tab_depth(depth), PTR_DIFF(inbuf,base),string)); \
- { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (outbuf)[idx])); } } \
+ { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", (outbuf)[idx])); } } \
+ DEBUG(5,("\n"));
+
+#define DBG_RW_PIVAL(string,depth,base,read,inbuf,outbuf,len) \
+ RW_PIVAL(read,inbuf,outbuf,len) \
+ DEBUG(5,("%s%04x %s: ", \
+ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \
+ { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", (outbuf)[idx])); } } \
DEBUG(5,("\n"));
#define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \
diff --git a/source3/pipentlsa.c b/source3/pipentlsa.c
index 9a57b6df9b..030e00e87a 100644
--- a/source3/pipentlsa.c
+++ b/source3/pipentlsa.c
@@ -61,8 +61,8 @@ static void make_dom_query(DOM_QUERY *d_q, char *dom_name, char *dom_sid)
d_q->uni_dom_max_len = domlen * 2;
d_q->uni_dom_str_len = domlen * 2;
- d_q->buffer_dom_name = 1; /* domain buffer pointer */
- d_q->buffer_dom_sid = 1; /* domain sid pointer */
+ d_q->buffer_dom_name = 4; /* domain buffer pointer */
+ d_q->buffer_dom_sid = 2; /* domain sid pointer */
/* this string is supposed to be character short */
make_unistr2(&(d_q->uni_domain_name), dom_name, domlen);
@@ -77,7 +77,7 @@ static int lsa_reply_query_info(LSA_Q_QUERY_INFO *q_q, char *q, char *base,
/* set up the LSA QUERY INFO response */
- r_q.undoc_buffer = 1; /* not null */
+ r_q.undoc_buffer = 0x22000000; /* bizarre */
r_q.info_class = q_q->info_class;
make_dom_query(&r_q.dom.id5, dom_name, dom_sid);
diff --git a/source3/pipeutil.c b/source3/pipeutil.c
index b9201f3c95..f55a8d2181 100644
--- a/source3/pipeutil.c
+++ b/source3/pipeutil.c
@@ -142,7 +142,7 @@ void create_rpc_reply(RPC_HDR *hdr, uint32 call_id, int data_len)
hdr->minor = 0; /* minor version 0 */
hdr->pkt_type = 2; /* RPC response packet */
hdr->frag = 3; /* first frag + last frag */
- hdr->pack_type = 1; /* packed data representation */
+ hdr->pack_type = 0x10; /* packed data representation */
hdr->frag_len = data_len; /* fragment length, fill in later */
hdr->auth_len = 0; /* authentication length */
hdr->call_id = call_id; /* call identifier - match incoming RPC */
@@ -154,7 +154,7 @@ void create_rpc_reply(RPC_HDR *hdr, uint32 call_id, int data_len)
int make_rpc_reply(char *inbuf, char *q, int data_len)
{
- uint32 callid = RIVAL(inbuf, 12);
+ uint32 callid = IVAL(inbuf, 12);
RPC_HDR hdr;
create_rpc_reply(&hdr, callid, data_len);
diff --git a/source3/smbparse.c b/source3/smbparse.c
index 39200f5351..855d46420a 100644
--- a/source3/smbparse.c
+++ b/source3/smbparse.c
@@ -71,9 +71,7 @@ char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align, int
DEBUG(5,("%s%04x smb_io_dom_sid\n", tab_depth(depth), PTR_DIFF(q, base)));
depth++;
- q = align_offset(q, base, align);
-
- DBG_RW_CVAL("num_auths ", depth, base, io, q, sid->num_auths); q++;
+ DBG_RW_IVAL("num_auths ", depth, base, io, q, sid->num_auths); q += 4;
DBG_RW_CVAL("sid_no ", depth, base, io, q, sid->sid_no); q++;
DBG_RW_CVAL("num_auths ", depth, base, io, q, sid->num_auths); q++;
@@ -87,7 +85,7 @@ char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align, int
/* oops! XXXX should really issue a warning here... */
if (sid->num_auths > MAXSUBAUTHS) sid->num_auths = MAXSUBAUTHS;
- DBG_RW_PSVAL("num_auths ", depth, base, io, q, sid->sub_auths, sid->num_auths); q += sid->num_auths * 2;
+ DBG_RW_PIVAL("num_auths ", depth, base, io, q, sid->sub_auths, sid->num_auths); q += sid->num_auths * 4;
return q;
}