summaryrefslogtreecommitdiff
path: root/source3/libads/ldap.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-04-13 14:39:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:13 -0500
commit8ad3d8c9b065f3a2040beff801bdc9dceac868a8 (patch)
tree8c0763ba095ca5386b5b06ddb3f10a05d9a85dcf /source3/libads/ldap.c
parent142f5604b56240054f088dce4703c714b7065106 (diff)
downloadsamba-8ad3d8c9b065f3a2040beff801bdc9dceac868a8.tar.gz
samba-8ad3d8c9b065f3a2040beff801bdc9dceac868a8.tar.bz2
samba-8ad3d8c9b065f3a2040beff801bdc9dceac868a8.zip
r196: merging struct uuid from trunk
(This used to be commit 911a28361b9d8dd50597627f245ebfb57c6294fb)
Diffstat (limited to 'source3/libads/ldap.c')
-rw-r--r--source3/libads/ldap.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 15504a5202..20a36dfdf5 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1106,20 +1106,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)));
}
}
@@ -1771,16 +1765,18 @@ BOOL ads_pull_uint32(ADS_STRUCT *ads,
* @return boolean indicating success
**/
BOOL ads_pull_guid(ADS_STRUCT *ads,
- void *msg, GUID *guid)
+ void *msg, struct uuid *guid)
{
char **values;
+ UUID_FLAT flat_guid;
values = ldap_get_values(ads->ld, msg, "objectGUID");
if (!values)
return False;
if (values[0]) {
- memcpy(guid, values[0], sizeof(GUID));
+ memcpy(&flat_guid.info, values[0], sizeof(UUID_FLAT));
+ smb_uuid_unpack(flat_guid, guid);
ldap_value_free(values);
return True;
}