composite rpc call

Stefan (metze) Metzmacher metze at
Tue Feb 22 11:31:18 GMT 2005

Hash: SHA1

Rafal Szczesniak schrieb:
| On Tue, Feb 22, 2005 at 11:55:27AM +0100, Rafal Szczesniak wrote:
|>On Tue, Feb 22, 2005 at 02:00:10PM +1100, Andrew Tridgell wrote:
|>> > Could you please take a look at source/libnet/userinfo.c file and tell
|>> > me what is coded incorrectly. I haven't tested it yet, so almost
|>> > certainly something is broken, but you surely have some opinion on
|>> > that code just by looking.
|>>I hope you don't mind me replying publicly. I thought that others
|>>might find the answers interesting.
|>Of course. It has some educational valor for potential samba hackers.
| ugh... s/valor/value/
|>>Lines like this:
|>>  memcpy((void*), (void*)rep->out.user_handle, sizeof(struct policy_handle));
|>>should be replaced with this:
|>> = rep->out.user_handle;
| One more question: Is there a function I could use to copy a policy
| handle structure ? In case I don't want to get the pointer, I need to
| copy it and I couldn't find such a function. Needs to be coded ? :)

why do you need a function to copy a fixed size struct?

struct policy_handle h1,h2,*p1 = h1, *p2 = h2;

if you want to copy with using the pointers, just use

*p2 = *p1;

or without the pointers

h2 = h1;


*p2 = h1;

or h2 = *p2;


- --

Stefan Metzmacher <metze at>
Version: GnuPG v1.2.3-nr1 (Windows XP)
Comment: Using GnuPG with Thunderbird -


More information about the samba-technical mailing list