GUID, RPC_UUID, struct uuid, and all that mess

Jim McDonough jmcd at
Thu Oct 30 02:32:12 GMT 2003

So we're pretty loose in how we approach uuid's (or whatever you want to
call them) in samba.  Sometimes we just define a uint8[16], sometimes two
slightly different structures.  Now that I'm dealing with the endpoint
mapper, it's getting quite hairy.

I'd like to work on cleaning this up.  I want to go with something like
we've got inside the lib/util_uuid.c code (because that seems to be the
most accurate definition we have):

  uint32 time_low;
  uint16 time_mid;
  uint16 time_hi_and_version;
  uint8  clock_seq[2];
  uint8  node[6];

My approach was going to be this:
1. convert the existing RPC_UUID struct to match the above (the only change
is splitting a uint8[8] into the last two fields) and all the associated
fn's (not very many).
2. change the LSA_DS stuff (and nmbd_processlogon and secrets) that use the
util_uuid routines to match this.  A couple stray other ones that print a
uuid might go here, too.
3. see how all that goes then consider converting the rest...printing, lsa,

An alternative is leaving a lot of those uint8[16] arrays around and expose
the pack and unpack routines...but it seems better if we just treat a uuid
as a structure, not both ways.  The only time I think we should consider it
just a byte stream is in a file and on the wire.

Opinions?  If none, I'll start making changes to HEAD...

Jim McDonough
IBM Linux Technology Center
Samba Team
6 Minuteman Drive
Scarborough, ME 04074

jmcd at
jmcd at

Phone: (207) 885-5565
IBM tie-line: 776-9984

More information about the samba-technical mailing list