First round of merging various UUID structures.
authorJim McDonough <jmcd@samba.org>
Thu, 30 Oct 2003 16:38:39 +0000 (16:38 +0000)
committerJim McDonough <jmcd@samba.org>
Thu, 30 Oct 2003 16:38:39 +0000 (16:38 +0000)
This eliminates RPC_UUID.  It creates the following struct:

struct uuid
{
  uint32 time_low;
  uint16 time_mid;
  uint16 time_hi_and_version;
  uint8  clock_seq[2];
  uint8  node[6];
};
which replaces RPC_UUID and various random struct uuid definitions

and a flat version:
#define UUID_FLAT_SIZE 16
typedef struct uuid_flat
{
uint8 info[UUID_FLAT_SIZE];
} UUID_FLAT;

which pretty much looks like GUID (which I will start eliminating).

I want us to use the FLAT one only on the wire (perhaps in files, too?), and
I want it to be obvious to the coder that it is the FLAT version.

This leaves a couple of compiler warnings, where GUID isn't completely
replaced by FLAT_UUID yet...I'll get to those soon.

17 files changed:
source/include/ntdomain.h
source/include/rpc_dce.h
source/include/rpc_ds.h
source/include/rpc_epmapper.h
source/lib/util_sid.c
source/lib/util_uuid.c
source/libads/ldap.c
source/passdb/secrets.c
source/rpc_parse/parse_ds.c
source/rpc_parse/parse_epmapper.c
source/rpc_parse/parse_rpc.c
source/rpc_server/srv_epmapper_nt.c
source/rpc_server/srv_pipe.c
source/rpc_server/srv_spoolss_nt.c
source/rpcclient/cmd_epmapper.c
source/rpcclient/cmd_lsarpc.c
source/utils/net_ads_cldap.c

index 5da6d86410a231c21abdacbb45bf50e0fed5df53..d9fff4d2a955a6a3e846635d8ab28c0ab5d53b3d 100644 (file)
 #ifndef _NT_DOMAIN_H /* _NT_DOMAIN_H */
 #define _NT_DOMAIN_H 
 
+struct uuid
+{
+  uint32 time_low;
+  uint16 time_mid;
+  uint16 time_hi_and_version;
+  uint8  clock_seq[2];
+  uint8  node[6];
+};
+#define UUID_SIZE 16
+
+#define UUID_FLAT_SIZE 16
+typedef struct uuid_flat
+{
+       uint8 info[UUID_FLAT_SIZE];
+} UUID_FLAT;
+
 /* dce/rpc support */
 #include "rpc_dce.h"
 
index 52fe08d8753b15bb6903dc14b5929bf3efdb5797..8266fc861f1ba291d235164dc4367828ed4ee21b 100644 (file)
@@ -87,29 +87,15 @@ enum netsec_direction
 /* #define MAX_PDU_FRAG_LEN 0x1630             this is what wnt sets */
 #define MAX_PDU_FRAG_LEN 0x10b8                        /* this is what w2k sets */
 
-/*
- * Actual structure of a DCE UUID
- */
-
-typedef struct rpc_uuid
-{
-  uint32 time_low;
-  uint16 time_mid;
-  uint16 time_hi_and_version;
-  uint8 remaining[8];
-} RPC_UUID;
-
-#define RPC_UUID_LEN 16
-
 /* RPC_IFACE */
 typedef struct rpc_iface_info
 {
-  RPC_UUID uuid;    /* 16 bytes of rpc interface identification */
+  struct uuid uuid;  /* 16 bytes of rpc interface identification */
   uint32 version;    /* the interface version number */
 
 } RPC_IFACE;
 
-#define RPC_IFACE_LEN (RPC_UUID_LEN + 4)
+#define RPC_IFACE_LEN (UUID_SIZE + 4)
 
 struct pipe_id_info
 {
index e2622be532c2e2925ce7c8fad55012b1d76a574d..4d3f5416ac2b3ab775961ae2544230415e0486cc 100644 (file)
@@ -64,7 +64,7 @@ typedef struct
        uint32          dnsname_ptr;
        uint32          forestname_ptr;
        
-       GUID            domain_guid;
+       struct uuid     domain_guid;
        
        UNISTR2 netbios_domain;
 
@@ -110,7 +110,7 @@ typedef struct {
        uint32          trust_type;
        uint32          trust_attributes;
        uint32          sid_ptr;
-       GUID            guid;
+       struct uuid     guid;
        
        UNISTR2         netbios_domain;
        UNISTR2         dns_domain;
index de3a2cb08d9e9f31476059de6cd0d1cd43aa0d00..bbca6ac1f28786248895827e9e9aaae3444b41e2 100644 (file)
@@ -51,7 +51,7 @@ typedef struct
                uint16 length;
                uint8 protocol;
                struct {
-                       RPC_UUID uuid;
+                       struct uuid uuid;
                        uint16 version;
                } uuid;
        } lhs;
index 50bbb4c72c61348f7e3457320035017a1aa8ac19..2c0bd7978597664d5663151cab826c4c42d0f734 100644 (file)
@@ -617,23 +617,6 @@ char *sid_binstring(const DOM_SID *sid)
        return s;
 }
 
-
-/*****************************************************************
- Print a GUID structure for debugging.
-*****************************************************************/
-
-void print_guid(GUID *guid)
-{
-       int i;
-
-       d_printf("%08x-%04x-%04x", 
-                IVAL(guid->info, 0), SVAL(guid->info, 4), SVAL(guid->info, 6));
-       d_printf("-%02x%02x-", guid->info[8], guid->info[9]);
-       for (i=10;i<GUID_SIZE;i++)
-               d_printf("%02x", guid->info[i]);
-       d_printf("\n");
-}
-
 /*******************************************************************
  Tallocs a duplicate SID. 
 ********************************************************************/ 
index 56f0ecd85b94a6a8d3850ec1a30eb0fa8de58a9f..8217006e58f230754b835a4d27de7844399aec85 100644 (file)
 #define TIME_OFFSET_HIGH 0x01B21DD2
 #define TIME_OFFSET_LOW  0x13814000
 
-struct uuid {
-        uint32   time_low;
-        uint16   time_mid;
-        uint16   time_hi_and_version;
-        uint8    clock_seq[2];
-        uint8    node[6];
-};
-
-
-static void uuid_pack(const struct uuid *uu, GUID *ptr)
+void smb_uuid_pack(const struct uuid *uu, UUID_FLAT *ptr)
 {
-       uint8 *out = ptr->info;
+       SIVAL(ptr, 0, uu->time_low);
+       SSVAL(ptr, 4, uu->time_mid);
+       SSVAL(ptr, 6, uu->time_hi_and_version);
+       memcpy(ptr+8, uu->clock_seq, 2);
+       memcpy(ptr+10, uu->node, 6);
+}
 
-       SIVAL(out, 0, uu->time_low);
-       SSVAL(out, 4, uu->time_mid);
-       SSVAL(out, 6, uu->time_hi_and_version);
-       memcpy(out+8, uu->clock_seq, 2);
-       memcpy(out+10, uu->node, 6);
+void smb_uuid_unpack(const UUID_FLAT in, struct uuid *uu)
+{
+       uu->time_low = IVAL(in.info, 0);
+       uu->time_mid = SVAL(in.info, 4);
+       uu->time_hi_and_version = SVAL(in.info, 6);
+       memcpy(uu->clock_seq, in.info+8, 2);
+       memcpy(uu->node, in.info+10, 6);
 }
 
-static void uuid_unpack(const GUID in, struct uuid *uu)
+const struct uuid smb_uuid_unpack_static(const UUID_FLAT in)
 {
-       const uint8 *ptr = in.info;
+       static struct uuid uu;
 
-       uu->time_low = IVAL(ptr, 0);
-       uu->time_mid = SVAL(ptr, 4);
-       uu->time_hi_and_version = SVAL(ptr, 6);
-       memcpy(uu->clock_seq, ptr+8, 2);
-       memcpy(uu->node, ptr+10, 6);
+       smb_uuid_unpack(in, &uu);
+       return uu;
 }
 
-void smb_uuid_generate_random(GUID *out)
+void smb_uuid_generate_random(struct uuid *uu)
 {
-       GUID tmp;
-       struct uuid uu;
+       UUID_FLAT tmp;
 
        generate_random_buffer(tmp.info, sizeof(tmp.info), True);
-       uuid_unpack(tmp, &uu);
+       smb_uuid_unpack(tmp, uu);
 
-       uu.clock_seq[0] = (uu.clock_seq[0] & 0x3F) | 0x80;
-       uu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF) | 0x4000;
-       uuid_pack(&uu, out);
+       uu->clock_seq[0] = (uu->clock_seq[0] & 0x3F) | 0x80;
+       uu->time_hi_and_version = (uu->time_hi_and_version & 0x0FFF) | 0x4000;
 }
 
-char *smb_uuid_to_string(const GUID in)
+char *smb_uuid_to_string(const struct uuid uu)
 {
-       struct uuid uu;
        char *out;
 
-       uuid_unpack(in, &uu);
-       
        asprintf(&out, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
                 uu.time_low, uu.time_mid, uu.time_hi_and_version,
                 uu.clock_seq[0], uu.clock_seq[1],
@@ -87,13 +77,11 @@ char *smb_uuid_to_string(const GUID in)
        return out;
 }
 
-const char *smb_uuid_string_static(const GUID in)
+const char *smb_uuid_string_static(const struct uuid uu)
 {
-       struct uuid uu;
        static char out[37];
 
-       uuid_unpack(in, &uu);
-       slprintf(out, sizeof(out) -1, 
+       slprintf(out, sizeof(out), 
                 "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
                 uu.time_low, uu.time_mid, uu.time_hi_and_version,
                 uu.clock_seq[0], uu.clock_seq[1],
index b3706cb2403cc28c0739dffa6d0d631bee5682a9..ed26bf07f281bed360fe7da6b9c2f3a2fa961726 100644 (file)
@@ -1091,20 +1091,14 @@ static void dump_binary(const char *field, struct berval **values)
        }
 }
 
-struct uuid {
-        uint32   i1;
-        uint16   i2;
-        uint16   i3;
-        uint8    s[8];
-};
-
 static void dump_guid(const char *field, struct berval **values)
 {
        int i;
-       GUID guid;
+       UUID_FLAT guid;
        for (i=0; values[i]; i++) {
                memcpy(guid.info, values[i]->bv_val, sizeof(guid.info));
-               printf("%s: %s\n", field, smb_uuid_string_static(guid));
+               printf("%s: %s\n", field, 
+                      smb_uuid_string_static(smb_uuid_unpack_static(guid)));
        }
 }
 
index 8a146f0d6887fd606d47a59b0e115577acf4573b..a5a2c29a8be5c666ff53c3c640e470ff5b89bf5d 100644 (file)
@@ -128,39 +128,38 @@ BOOL secrets_fetch_domain_sid(const char *domain, DOM_SID *sid)
        return True;
 }
 
-BOOL secrets_store_domain_guid(const char *domain, GUID *guid)
+BOOL secrets_store_domain_guid(const char *domain, struct uuid *guid)
 {
        fstring key;
 
        slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_GUID, domain);
        strupper_m(key);
-       return secrets_store(key, guid, sizeof(GUID));
+       return secrets_store(key, guid, sizeof(struct uuid));
 }
 
-BOOL secrets_fetch_domain_guid(const char *domain, GUID *guid)
+BOOL secrets_fetch_domain_guid(const char *domain, struct uuid *guid)
 {
-       GUID *dyn_guid;
+       struct uuid *dyn_guid;
        fstring key;
        size_t size;
-       GUID new_guid;
+       struct uuid new_guid;
 
        slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_GUID, domain);
        strupper_m(key);
-       dyn_guid = (GUID *)secrets_fetch(key, &size);
+       dyn_guid = (struct uuid *)secrets_fetch(key, &size);
 
-       DEBUG(6,("key is %s, size is %d\n", key, (int)size));
-
-       if ((NULL == dyn_guid) && (ROLE_DOMAIN_PDC == lp_server_role())) {
+       if ((!dyn_guid) && (lp_server_role() == ROLE_DOMAIN_PDC)) {
                smb_uuid_generate_random(&new_guid);
                if (!secrets_store_domain_guid(domain, &new_guid))
                        return False;
-               dyn_guid = (GUID *)secrets_fetch(key, &size);
+               dyn_guid = (struct uuid *)secrets_fetch(key, &size);
                if (dyn_guid == NULL)
                        return False;
        }
 
-       if (size != sizeof(GUID))
+       if (size != sizeof(struct uuid))
        { 
+               DEBUG(1,("UUID size %d is wrong!\n", (int)size));
                SAFE_FREE(dyn_guid);
                return False;
        }
index 26dcdb34b8b957344c03aa766ba4ec08271e8b32..8d894b6c6add436f11ef3a7a1d1c646dbced4748 100644 (file)
@@ -48,8 +48,8 @@ static BOOL ds_io_dominfobasic( const char *desc, prs_struct *ps, int depth, DSR
                return False;
        if ( !prs_uint32("forestname_ptr", ps, depth, &p->forestname_ptr) )
                return False;
-               
-       if ( !prs_uint8s(False, "domain_guid", ps, depth, p->domain_guid.info, GUID_SIZE) )
+
+       if ( !smb_io_uuid("domain_guid", &p->domain_guid, ps, depth) )
                return False;
                
        if ( !smb_io_unistr2( "netbios_domain", &p->netbios_domain, p->netbios_ptr, ps, depth) )
@@ -179,7 +179,7 @@ static BOOL ds_io_domain_trusts( const char *desc, prs_struct *ps, int depth, DS
        if ( !prs_uint32( "sid_ptr", ps, depth, &trust->sid_ptr ) )
                return False;
        
-       if ( !prs_uint8s(False, "guid", ps, depth, trust->guid.info, GUID_SIZE) )
+       if ( !smb_io_uuid("guid", &trust->guid, ps, depth) )
                return False;
        
        return True;    
index 7a5f147c507dd16d51ae4c9757a2fbc33c11d471..89dc0994c613e39cfe8c668fb1456bddb113a25e 100644 (file)
@@ -88,9 +88,9 @@ NTSTATUS init_epm_floor(EPM_FLOOR *floor, uint8 protocol)
  inits an EPM_FLOOR structure with a UUID
 ********************************************************************/
 NTSTATUS init_epm_floor_uuid(EPM_FLOOR *floor,
-                            const RPC_UUID *uuid, uint16 version)
+                            const struct uuid uuid, uint16 version)
 {
-       memcpy(&floor->lhs.uuid.uuid, uuid, sizeof(*uuid));
+       memcpy(&floor->lhs.uuid.uuid, &uuid, sizeof(uuid));
        floor->lhs.uuid.version = version;
        floor->rhs.unknown = 0;
        return init_epm_floor(floor, EPM_FLOOR_UUID);
@@ -166,7 +166,7 @@ BOOL epm_io_floor(const char *desc, EPM_FLOOR *floor,
 
        switch (floor->lhs.protocol) {
        case EPM_FLOOR_UUID:
-               if (!smb_io_rpc_uuid("uuid", &floor->lhs.uuid.uuid, ps, depth))
+               if (!smb_io_uuid("uuid", &floor->lhs.uuid.uuid, ps, depth))
                        return False;
                if (!prs_uint16("version", ps, depth, 
                                &floor->lhs.uuid.version))
index 18ac37778c77e085331bf933482bafab40f1a389..1718841cf7dcdbff15bcf51d2c7cca52ca46e1e9 100644 (file)
@@ -34,8 +34,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                0x8a885d04, 0x1ceb, 0x11c9, \
-               { 0x9f, 0xe8, 0x08, 0x00,   \
-               0x2b, 0x10, 0x48, 0x60 }    \
+               { 0x9f, 0xe8 },             \
+               { 0x08, 0x00,               \
+                         0x2b, 0x10, 0x48, 0x60 }  \
        }, 0x02                             \
 }
 
@@ -43,8 +44,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                0x8a885d04, 0x1ceb, 0x11c9, \
-               { 0x9f, 0xe8, 0x08, 0x00,   \
-               0x2b, 0x10, 0x48, 0x60 }    \
+               { 0x9f, 0xe8 },             \
+               { 0x08, 0x00,               \
+                 0x2b, 0x10, 0x48, 0x60 }  \
        }, 0x02                             \
 }
 
@@ -52,8 +54,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                0x6bffd098, 0xa112, 0x3610, \
-               { 0x98, 0x33, 0x46, 0xc3,   \
-               0xf8, 0x7e, 0x34, 0x5a }    \
+               { 0x98, 0x33 },             \
+               { 0x46, 0xc3,               \
+                 0xf8, 0x7e, 0x34, 0x5a }  \
        }, 0x01                             \
 }
 
@@ -61,8 +64,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                0x4b324fc8, 0x1670, 0x01d3, \
-               { 0x12, 0x78, 0x5a, 0x47,   \
-               0xbf, 0x6e, 0xe1, 0x88 }    \
+               { 0x12, 0x78 },             \
+               { 0x5a, 0x47,               \
+                 0xbf, 0x6e, 0xe1, 0x88 }  \
        }, 0x03                             \
 }
 
@@ -70,8 +74,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                0x12345778, 0x1234, 0xabcd, \
-               { 0xef, 0x00, 0x01, 0x23,   \
-               0x45, 0x67, 0x89, 0xab }    \
+               { 0xef, 0x00 },             \
+               { 0x01, 0x23,               \
+                 0x45, 0x67, 0x89, 0xab }  \
        }, 0x00                             \
 }
 
@@ -79,8 +84,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                0x3919286a, 0xb10c, 0x11d0, \
-               { 0x9b, 0xa8, 0x00, 0xc0,   \
-               0x4f, 0xd9, 0x2e, 0xf5 }    \
+               { 0x9b, 0xa8 },             \
+               { 0x00, 0xc0,               \
+                 0x4f, 0xd9, 0x2e, 0xf5 }  \
        }, 0x00                             \
 }
 
@@ -88,8 +94,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                0x12345778, 0x1234, 0xabcd, \
-               { 0xef, 0x00, 0x01, 0x23,   \
-               0x45, 0x67, 0x89, 0xac }    \
+               { 0xef, 0x00 },             \
+               { 0x01, 0x23,               \
+                 0x45, 0x67, 0x89, 0xac }  \
        }, 0x01                             \
 }
 
@@ -97,8 +104,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                0x12345678, 0x1234, 0xabcd, \
-               { 0xef, 0x00, 0x01, 0x23,   \
-               0x45, 0x67, 0xcf, 0xfb }    \
+               { 0xef, 0x00 },             \
+               { 0x01, 0x23,               \
+                 0x45, 0x67, 0xcf, 0xfb }  \
        }, 0x01                             \
 }
 
@@ -106,8 +114,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                0x338cd001, 0x2244, 0x31f1, \
-               { 0xaa, 0xaa, 0x90, 0x00,   \
-               0x38, 0x00, 0x10, 0x03 }    \
+               { 0xaa, 0xaa },             \
+               { 0x90, 0x00,               \
+                 0x38, 0x00, 0x10, 0x03 }  \
        }, 0x01                             \
 }
 
@@ -115,8 +124,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                0x12345678, 0x1234, 0xabcd, \
-               { 0xef, 0x00, 0x01, 0x23,   \
-               0x45, 0x67, 0x89, 0xab }    \
+               { 0xef, 0x00 },             \
+               { 0x01, 0x23,               \
+                 0x45, 0x67, 0x89, 0xab }  \
        }, 0x01                             \
 }
 
@@ -124,8 +134,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                0x0, 0x0, 0x0,              \
-               { 0x00, 0x00, 0x00, 0x00,   \
-               0x00, 0x00, 0x00, 0x00 }    \
+               { 0x00, 0x00 },             \
+               { 0x00, 0x00,               \
+                 0x00, 0x00, 0x00, 0x00 }  \
        }, 0x00                             \
 }
 
@@ -133,7 +144,8 @@ interface/version dce/rpc pipe identification
 {                                           \
         {                                   \
                 0x4fc742e0, 0x4a10, 0x11cf, \
-                { 0x82, 0x73, 0x00, 0xaa,   \
+                { 0x82, 0x73 },             \
+               { 0x00, 0xaa,               \
                   0x00, 0x4a, 0xe6, 0x73 }  \
         }, 0x03                             \
 }
@@ -142,7 +154,8 @@ interface/version dce/rpc pipe identification
 {                                           \
         {                                   \
                 0x60a15ec5, 0x4de8, 0x11d7, \
-                { 0xa6, 0x37, 0x00, 0x50,   \
+                { 0xa6, 0x37 },             \
+               { 0x00, 0x50,               \
                   0x56, 0xa2, 0x01, 0x82 }  \
         }, 0x01                             \
 }
@@ -151,7 +164,8 @@ interface/version dce/rpc pipe identification
 {                                           \
         {                                   \
                 0x894de0c0, 0x0d55, 0x11d3, \
-                { 0xa3, 0x22, 0x00, 0xc0,   \
+                { 0xa3, 0x22 },             \
+               { 0x00, 0xc0,               \
                   0x4f, 0xa3, 0x21, 0xa1 }  \
         }, 0x01                             \
 }
@@ -160,8 +174,9 @@ interface/version dce/rpc pipe identification
 {                                           \
        {                                   \
                 0xe1af8308, 0x5d1f, 0x11c9, \
-                {  0x91, 0xa4, 0x08, 0x00,  \
-                   0x2b, 0x14, 0xa0, 0xfa } \
+                { 0x91, 0xa4 },             \
+               { 0x08, 0x00,               \
+                  0x2b, 0x14, 0xa0, 0xfa }  \
        }, 0x03                             \
 }
 
@@ -263,15 +278,16 @@ BOOL smb_io_rpc_hdr(const char *desc,  RPC_HDR *rpc, prs_struct *ps, int depth)
 }
 
 /*******************************************************************
- Reads or writes an RPC_UUID structure.
+ Reads or writes a struct uuid
 ********************************************************************/
 
-BOOL smb_io_rpc_uuid(const char *desc, RPC_UUID *uuid, prs_struct *ps, int depth)
+BOOL smb_io_uuid(const char *desc, struct uuid *uuid, 
+                prs_struct *ps, int depth)
 {
        if (uuid == NULL)
                return False;
 
-       prs_debug(ps, depth, desc, "smb_io_rpc_uuid");
+       prs_debug(ps, depth, desc, "smb_io_uuid");
        depth++;
 
        if(!prs_uint32 ("data   ", ps, depth, &uuid->time_low))
@@ -281,7 +297,9 @@ BOOL smb_io_rpc_uuid(const char *desc, RPC_UUID *uuid, prs_struct *ps, int depth
        if(!prs_uint16 ("data   ", ps, depth, &uuid->time_hi_and_version))
                return False;
 
-       if(!prs_uint8s (False, "data   ", ps, depth, uuid->remaining, sizeof(uuid->remaining)))
+       if(!prs_uint8s (False, "data   ", ps, depth, uuid->clock_seq, sizeof(uuid->clock_seq)))
+               return False;
+       if(!prs_uint8s (False, "data   ", ps, depth, uuid->node, sizeof(uuid->node)))
                return False;
 
        return True;
@@ -302,7 +320,7 @@ static BOOL smb_io_rpc_iface(const char *desc, RPC_IFACE *ifc, prs_struct *ps, i
        if (!prs_align(ps))
                return False;
 
-       if (!smb_io_rpc_uuid(  "uuid", &ifc->uuid, ps, depth))
+       if (!smb_io_uuid(  "uuid", &ifc->uuid, ps, depth))
                return False;
 
        if(!prs_uint32 ("version", ps, depth, &ifc->version))
index 1b72a5ed41906ad9f0eaddbc3794d5449697ab8c..e82484af4af3034ee5f80a2964aa79d428a0b4e1 100644 (file)
@@ -43,7 +43,7 @@ void _epm_map(pipes_struct *ps, const EPM_Q_MAP *q_u, EPM_R_MAP *r_u)
                switch (q_u->tower->floors[i].lhs.protocol) {
                 case EPM_FLOOR_UUID:
                        init_epm_floor_uuid(&floors[i],
-                                           &q_u->tower->floors[i].
+                                           q_u->tower->floors[i].
                                            lhs.uuid.uuid,
                                            q_u->tower->floors[i].
                                            lhs.uuid.version);
index 444c35987acd1665317c31f3be580f206f515773..7bbe726f5ae04495c272ae2cbec4f2c14666d0a6 100644 (file)
@@ -731,9 +731,9 @@ BOOL check_bind_req(struct pipes_struct *p, RPC_IFACE* abstract,
        {
                if ( strequal(pipe_names[i].client_pipe, pname)
                        && (abstract->version == pipe_names[i].abstr_syntax.version) 
-                       && (memcmp(&abstract->uuid, &pipe_names[i].abstr_syntax.uuid, sizeof(RPC_UUID)) == 0)
+                       && (memcmp(&abstract->uuid, &pipe_names[i].abstr_syntax.uuid, sizeof(struct uuid)) == 0)
                        && (transfer->version == pipe_names[i].trans_syntax.version)
-                       && (memcmp(&transfer->uuid, &pipe_names[i].trans_syntax.uuid, sizeof(RPC_UUID)) == 0) )
+                       && (memcmp(&transfer->uuid, &pipe_names[i].trans_syntax.uuid, sizeof(struct uuid)) == 0) )
                {
                        struct api_struct       *fns = NULL;
                        int                     n_fns = 0;
index 15578f6148293d2108ff4575160f1fb160cecfac..ad8f5af432c466dc2748caf3bacb678adc311d7c 100644 (file)
@@ -4358,10 +4358,11 @@ static BOOL construct_printer_info_5(Printer_entry *print_hnd, PRINTER_INFO_5 *p
 static BOOL construct_printer_info_7(Printer_entry *print_hnd, PRINTER_INFO_7 *printer, int snum)
 {
        char *guid_str = NULL;
-       GUID guid;
+       UUID_FLAT guid;
        
        if (is_printer_published(print_hnd, snum, &guid)) {
-               asprintf(&guid_str, "{%s}", smb_uuid_string_static(guid));
+               asprintf(&guid_str, "{%s}", 
+                        smb_uuid_string_static(smb_uuid_unpack_static(guid)));
                strupper_m(guid_str);
                init_unistr(&printer->guid, guid_str);
                printer->action = SPOOL_DS_PUBLISH;
index e2eecb6f04966e601aff5c9f51b78f0a505bfa4e..4998286194c281326ed5af6296b8027f67219bfb 100644 (file)
@@ -34,19 +34,21 @@ static NTSTATUS cmd_epm_map(struct cli_state *cli,
        uint32 numtowers;
        /* need to allow all this stuff to be passed in, but
           for now, it demonstrates the call */
-       RPC_UUID if_uuid = {0xe3514235, 0x4b06, 0x11d1, \
-                           { 0xab, 0x04, 0x00, 0xc0,   \
-                             0x4f, 0xc2, 0xdc, 0xd2 }},
-               syn_uuid = {0x8a885d04, 0x1ceb, 0x11c9, \
-                           { 0x9f, 0xe8, 0x08, 0x00,   \
-                             0x2b, 0x10, 0x48, 0x60 }};
+       struct uuid if_uuid = {0xe3514235, 0x4b06, 0x11d1, \
+                              { 0xab, 0x04 },             \
+                              { 0x00, 0xc0,               \
+                                0x4f, 0xc2, 0xdc, 0xd2 } },
+                  syn_uuid = {0x8a885d04, 0x1ceb, 0x11c9, \
+                              { 0x9f, 0xe8 },             \
+                              { 0x08, 0x00,               \
+                                0x2b, 0x10, 0x48, 0x60 } };
 
        NTSTATUS result;
 
        ZERO_STRUCT(handle);
        numtowers = 1;
-       init_epm_floor_uuid(&floors[0], &if_uuid, 4);
-       init_epm_floor_uuid(&floors[1], &syn_uuid, 2);
+       init_epm_floor_uuid(&floors[0], if_uuid, 4);
+       init_epm_floor_uuid(&floors[1], syn_uuid, 2);
        init_epm_floor_rpc(&floors[2]);
 
        /* sample for netbios named pipe query  
index db74370bc0bd0299f696d876628fb94e004d3af9..d4509eae444d2abc7e581722fdacff11b53e82bb 100644 (file)
@@ -69,7 +69,7 @@ static NTSTATUS cmd_lsa_query_info_policy(struct cli_state *cli,
        POLICY_HND pol;
        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
        DOM_SID dom_sid;
-       GUID dom_guid;
+       UUID_FLAT dom_guid;
        fstring sid_str, domain_name="", dns_name="", forest_name="";
        uint32 info_class = 3;
 
@@ -123,8 +123,9 @@ static NTSTATUS cmd_lsa_query_info_policy(struct cli_state *cli,
                printf("forest name is %s\n", forest_name);
 
        if (info_class == 12) {
-               printf("domain GUID is ");
-               print_guid(&dom_guid);
+               printf("domain GUID is %s\n",
+                      smb_uuid_string_static(
+                              smb_uuid_unpack_static(dom_guid)));
        }
  done:
        return result;
index 44de9cb89117e7993ed340836c5881a8158a6502..1903172cf75d8ac8790f83e3d04cddf96c473cde 100644 (file)
@@ -29,7 +29,7 @@
 struct cldap_netlogon_reply {
        uint32 type;
        uint32 flags;
-       GUID guid;
+       UUID_FLAT guid;
 
        char forest[MAX_DNS_LABEL];
        char domain[MAX_DNS_LABEL];
@@ -241,8 +241,8 @@ static int recv_cldap_netlogon(int sock, struct cldap_netlogon_reply *reply)
        reply->type = IVAL(p, 0); p += 4;
        reply->flags = IVAL(p, 0); p += 4;
 
-       memcpy(&reply->guid.info, p, GUID_SIZE);
-       p += GUID_SIZE;
+       memcpy(&reply->guid.info, p, UUID_FLAT_SIZE);
+       p += UUID_FLAT_SIZE;
 
        p += pull_netlogon_string(reply->forest, p, (const char *)os3.data);
        p += pull_netlogon_string(reply->domain, p, (const char *)os3.data);
@@ -316,8 +316,8 @@ int ads_cldap_netlogon(ADS_STRUCT *ads)
                d_printf("0x%x\n", reply.type);
                break;
        }
-       d_printf("GUID: "); 
-       print_guid(&reply.guid);
+       d_printf("GUID: %s\n", 
+                smb_uuid_string_static(smb_uuid_unpack_static(reply.guid))); 
        d_printf("Flags:\n"
                 "\tIs a PDC:                                   %s\n"
                 "\tIs a GC of the forest:                      %s\n"