diff options
author | Jeremy Allison <jra@samba.org> | 1998-04-10 18:21:16 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-04-10 18:21:16 +0000 |
commit | e300c0346ff92035ff9568b55b34469193e29769 (patch) | |
tree | f4d6a8527410556a158c548f091011885016d9dc /source3/rpc_server/srv_pipe_hnd.c | |
parent | 31ae9c7013be791717f6e77794ce8c8fc1c1c16c (diff) | |
download | samba-e300c0346ff92035ff9568b55b34469193e29769.tar.gz samba-e300c0346ff92035ff9568b55b34469193e29769.tar.bz2 samba-e300c0346ff92035ff9568b55b34469193e29769.zip |
includes.h: Moved HPUX undefine of SEMMSL to where it actually does something.
ipc.c: Added Luke's debug statement.
locking_slow.c: Added FTRUNCATE_NEEDS_ROOT code for broken systems that
need it (not sure what these are yet).
membuffer.c ntdomain.h proto.h
lib/rpc/include/rpc_dce.h lib/rpc/include/rpc_srvsvc.h
lib/rpc/parse/parse_prs.c lib/rpc/parse/parse_rpc.c
lib/rpc/server/srv_pipe_hnd.c lib/rpc/server/srv_util.c:
Re-merge of Luke's NTDOM changes 'cos he's a lazy git with
carpel tunnel syndrome :-).
Jeremy.
(This used to be commit 52e3966fbcf7b5fbdbc7cbe9ac0b453ab5bf3217)
Diffstat (limited to 'source3/rpc_server/srv_pipe_hnd.c')
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index e4893fee89..a371e48bfd 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -157,9 +157,10 @@ int read_pipe(uint16 pnum, char *data, uint32 pos, int n) if (OPEN_PNUM(pnum - PIPE_HANDLE_OFFSET)) { - int num; - int len; - uint32 rpc_frag_pos; + int num = 0; + int len = 0; + uint32 hdr_num = 0; + uint32 rpc_frag_pos = 0; DEBUG(6,("OK\n")); @@ -169,9 +170,14 @@ int read_pipe(uint16 pnum, char *data, uint32 pos, int n) return 0; } + DEBUG(6,("read_pipe: p: %p max_rdata_len: %d data_pos: %d num: %d\n", + p, p->max_rdata_len, data_pos, num)); + /* the read request starts from where the SMBtrans2 left off. */ data_pos += p->max_rdata_len; + rpc_frag_pos = data_pos % p->hdr.frag_len; + /* headers accumulate an offset */ data_pos -= p->hdr_offsets; @@ -182,22 +188,32 @@ int read_pipe(uint16 pnum, char *data, uint32 pos, int n) if (!IS_BITS_SET_ALL(p->hdr.flags, RPC_FLG_LAST)) { - rpc_frag_pos = data_pos % p->hdr.frag_len; + DEBUG(5,("read_pipe: hdr_offsets: %d rpc_frag_pos: %d frag_len: %d\n", + p->hdr_offsets, rpc_frag_pos, p->hdr.frag_len)); if (rpc_frag_pos == 0) { + /* this is subtracted from the total data bytes, later */ + hdr_num = 0x18; + /* create and copy in a new header. */ create_rpc_reply(p, data_pos, p->rdata.offset); mem_buf_copy(data, p->rhdr.data, 0, 0x18); /* make room in data stream for header */ p->hdr_offsets += 0x18; + data += 0x18; + + DEBUG(6,("read_pipe: hdr_offsets: %d\n", p->hdr_offsets)); } } if (num > 0) { - mem_buf_copy(data, p->rhdr.data, data_pos, num); + DEBUG(6,("read_pipe: adjusted data_pos: %d num: %d\n", + data_pos, num - hdr_num)); + mem_buf_copy(data, p->rhdr.data, data_pos, num - hdr_num); + return num; } |