PATCH rpc server

Tim Potter tpot at
Mon Jan 21 18:06:02 GMT 2002

On Tue, Jan 22, 2002 at 12:35:32PM +1100, Andrew Bartlett wrote:

> > This patch contains the rpc server modifications required by the addition of
> > the share management client code

Wow - that's good stuff!  Thanks Nigel.

> Just to let you know that I'll take on getting this into HEAD as one of
> my projects for this week.  I'll do the client code as well.
> Thankyou *very* much - this patch looks pretty good!

All the copyrights are dated 2001 - is this correct?

I would be very keen to get rid of any ptr_ members in any new rpc
code.  There's no need to keep the value of an embedded pointer after
it has been unmarshalled as it's easy to tell from the structure what the
value of the pointer should be.

e.g a fictional NET_FOO structure that contains a pointer to a bar

struct NET_FOO {
	uint32 ptr_foo;
	struct foo *bar;

should be replaced with:

struct NET_FOO {
	struct foo *bar;

When the structure is unmarshalled and the pointer is zero, set the
struct foo *bar to NULL.  When marshalling, if struct foo *bar is NULL
then write out a zero pointer, else write out a one (or 0xdeadbeef (-:).

These silly ptr_whatevers are all through the existing code and it's
probably too much effort to remove them.  It would be great to have new
code not persisting in this practice though.


More information about the samba-technical mailing list