Custom named pipes

Gerry Jacobs gerryjacobs at tiscali.be
Sat Sep 14 15:21:01 GMT 2002


>-- Origineel Bericht --
>From: jra at dp.samba.org
>To: Gerry Jacobs <gerryjacobs at tiscali.be>
>Cc: samba-technical at samba.org
>Subject: Re: Custom named pipes
>Date: Fri, 13 Sep 2002 22:11:42 +0000
>
>
>On Sat, Sep 14, 2002 at 12:08:21AM +0200, Gerry Jacobs wrote:
>> 
>> Btw I think I found a bug in the reply_pipe_write_and_X in smbd/pipes.c.
>> I suppose that this function is only used for reading pure data from named
>> pipes. But in this function you do a reply (write_to_pipe).
>> When I sent a large string (> RPC_HEADER_LEN), I ran into trouble.
>> The string was somewhere parsed in smaller parts. Each part was checked
>for
>> a correct RPC header.
>> But I was sending pure data without any headers and this was causing some
>> errors. Anyway, I changed the following 2 lines in that function:
>> 
>>    // nrwritten=write_to_pipe(p,data,numtowrite);
>>    nrwritten=numtowrite;
>> 
>> With these changes, I was able to send 10K with no problems.
>> But as I said, I don't know if this function is used for some other
>> SMB functions.
>
>Yeah you can't do that. RPC traffic has to be broken up into PDU
>sized units - each with it's own RPC header. You will break the
>other named pipes by doing this.
>
>Jeremy.

Correct. I was unable to change the samba password via a remote 
pc using the changes above. So it seems that it should sometimes reply
something back.
I guess it's not needed when my WinBox writes something in a custom
made pipe.
I could run multiple WriteFile calls without any error logging.
So I added a boolean 'custom_nt_pipe' variable to the pipes_struct.
This boolean is set to true if the connecting pipe is not found in
the known_nt_pipes array.
I replaced the changes above by:

if (p->custom_nt_pipe)
  nwritten=numtowrite;
else
  nwritten=write_to_pipe(p, data, numtowrite);

The other pipe code will then still work.

Regards,

Gerry Jacobs


--------------------------------------------------
Big Brother Anders  - With Tiscali you will see it all !  Check it up on
 www.tiscali.be/bigbrother





More information about the samba-technical mailing list