1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-19 21:57:57 +03:00

byteorder.h:

created a RW_PIVAL macro which was missing.

smbparse.c:

	smb_io_dom_sid() was storing its sub-authorities as uint16s instead
	of uint32s.  used the DBG_RW_PIVAL macro instead of DBG_RW_PSVAL.

pipentlsa.c:

	not sure.  something to do with the Query Info reply.

pipeutil.c:

	make_rpc_reply() had the packed representation field set to 0x0100 0000
	instead of 0x1000 0000, which had the interesting result of turning all
	uint32 and uint16 field byte ordering the other way round!
This commit is contained in:
Luke Leighton -
parent 9b095887df
commit eafd6e9e79
4 changed files with 20 additions and 11 deletions

View File

@ -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) \

View File

@ -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);

View File

@ -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);

View File

@ -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;
}