outsourcing DCE/RPC to alternate programs - runtime config option

Anthony Liguori aliguori at us.ibm.com
Thu Dec 9 21:46:39 GMT 2004


On Thu, 2004-12-09 at 15:34, Jeremy Allison wrote:
> On Thu, Dec 09, 2004 at 03:26:36PM -0600, Anthony Liguori wrote:
> > 
> > Couple things to note.
> > 
> > 1) namedpipe_read and namedpipe_write's semantics aren't universally
> > obeyed.  While testing, I found that Samba does not handle partial reads
> > or partial writes.  
> 
> In what way ? Can you explain the failures here please ?

Yeah, the interface seems to be designed to support partial reads and
writes.  I tested it by trying to return a partial read or write.  I
tried different values for partial read and write.  The follow is from
trying to do a read 1 byte at a time.

The read and write were never called again.  The error from the client
was:

[2004/12/09 15:17:15, 0] rpc_parse/parse_prs.c:prs_mem_get(530)
  prs_mem_get: reading data of size 1 would overrun buffer.

The read interface gets called from two places:
ipc.c:api_rpc_trans_reply and pipes.c:reply_pipe_read_and_X

It seems like these pieces of code should be reading as much as possible
from the pipe before sending.

I'm not sure what the partial read rules are over a named pipe.  This is
why I didn't make these changes..

> That's ok. Any library using this interface is part of Samba and will
> understand these things.

Ok, I'm still not going to write a header file then.  I guess they'd
have to include "includes.h" since I don't want to force
connection_struct to be part of an external interface.

> > I tested it and it seems to work.  It executes the pipe as the
> > appropriate user, reads and writes correctly.
> 
> Cool !
> 
> > I didn't write a header file either which I imagine is necessary because
> > I was unsure of how such a thing should be licensed..  Could these
> > modules be non-GPL?
> 
> Nope - must be GPL.
> 
> Jeremy.
-- 
Anthony Liguori
Samba, Linux/Windows Interoperability
Linux Technology Center (LTC) - IBM Austin
E-mail: aliguori at us.ibm.com
Phone: (512) 838-1208
Tie Line: 678-1208



More information about the samba-technical mailing list