1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-22 05:57:43 +03:00

Use GUID_string rather than smb_uuid_string().

This commit is contained in:
Jelmer Vernooij 2008-10-14 02:26:18 +02:00
parent 7e5bbe8069
commit 1f3e4f39c5
9 changed files with 16 additions and 33 deletions

View File

@ -1763,7 +1763,6 @@ int islower_ascii(int c);
void smb_uuid_pack(const struct GUID uu, UUID_FLAT *ptr);
void smb_uuid_unpack(const UUID_FLAT in, struct GUID *uu);
void smb_uuid_generate_random(struct GUID *uu);
const char *smb_uuid_string(TALLOC_CTX *mem_ctx, const struct GUID uu);
bool smb_string_to_uuid(const char *in, struct GUID* uu);
char *guid_binstring(const struct GUID *guid);

View File

@ -157,13 +157,13 @@ static void disp_sec_ace_object(struct security_ace_object *object)
{
if (object->flags & SEC_ACE_OBJECT_PRESENT) {
printf("Object type: SEC_ACE_OBJECT_PRESENT\n");
printf("Object GUID: %s\n", smb_uuid_string(talloc_tos(),
object->type.type));
printf("Object GUID: %s\n", GUID_string(talloc_tos(),
&object->type.type));
}
if (object->flags & SEC_ACE_OBJECT_INHERITED_PRESENT) {
printf("Object type: SEC_ACE_OBJECT_INHERITED_PRESENT\n");
printf("Object GUID: %s\n", smb_uuid_string(talloc_tos(),
object->inherited_type.inherited_type));
printf("Object GUID: %s\n", GUID_string(talloc_tos(),
&object->inherited_type.inherited_type));
}
}

View File

@ -55,22 +55,6 @@ void smb_uuid_generate_random(struct GUID *uu)
uu->time_hi_and_version = (uu->time_hi_and_version & 0x0FFF) | 0x4000;
}
const char *smb_uuid_string(TALLOC_CTX *mem_ctx, const struct GUID uu)
{
char *result;
result = talloc_asprintf(
mem_ctx,
"%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],
uu.node[0], uu.node[1], uu.node[2],
uu.node[3], uu.node[4], uu.node[5]);
SMB_ASSERT(result != NULL);
return result;
}
bool smb_string_to_uuid(const char *in, struct GUID* uu)
{
bool ret = False;

View File

@ -114,15 +114,15 @@ static void ads_disp_sec_ace_object(ADS_STRUCT *ads,
{
if (object->flags & SEC_ACE_OBJECT_PRESENT) {
printf("Object type: SEC_ACE_OBJECT_PRESENT\n");
printf("Object GUID: %s (%s)\n", smb_uuid_string(mem_ctx,
object->type.type),
printf("Object GUID: %s (%s)\n", GUID_string(mem_ctx,
&object->type.type),
ads_interprete_guid_from_object(ads, mem_ctx,
&object->type.type));
}
if (object->flags & SEC_ACE_OBJECT_INHERITED_PRESENT) {
printf("Object type: SEC_ACE_OBJECT_INHERITED_PRESENT\n");
printf("Object GUID: %s (%s)\n", smb_uuid_string(mem_ctx,
object->inherited_type.inherited_type),
printf("Object GUID: %s (%s)\n", GUID_string(mem_ctx,
&object->inherited_type.inherited_type),
ads_interprete_guid_from_object(ads, mem_ctx,
&object->inherited_type.inherited_type));
}

View File

@ -2062,7 +2062,7 @@ static void dump_guid(ADS_STRUCT *ads, const char *field, struct berval **values
memcpy(guid.info, values[i]->bv_val, sizeof(guid.info));
smb_uuid_unpack(guid, &tmp);
printf("%s: %s\n", field, smb_uuid_string(talloc_tos(), tmp));
printf("%s: %s\n", field, GUID_string(talloc_tos(), &tmp));
}
}
@ -3748,7 +3748,7 @@ const char *ads_get_extended_right_name_by_guid(ADS_STRUCT *ads,
}
expr = talloc_asprintf(mem_ctx, "(rightsGuid=%s)",
smb_uuid_string(mem_ctx, *rights_guid));
GUID_string(mem_ctx, rights_guid));
if (!expr) {
goto done;
}

View File

@ -3221,7 +3221,7 @@ static void store_printer_guid(NT_PRINTER_INFO_LEVEL_2 *info2,
ZERO_STRUCT( unistr_guid );
init_unistr2( &unistr_guid, smb_uuid_string(talloc_tos(), guid),
init_unistr2( &unistr_guid, GUID_string(talloc_tos(), &guid),
UNI_STR_TERMINATE );
regval_ctr_addvalue(ctr, "objectGUID", REG_SZ,
@ -3841,7 +3841,7 @@ static int unpack_values(NT_PRINTER_DATA *printer_data, const uint8 *buf, int bu
memcpy( &guid, data_p, sizeof(struct GUID) );
init_unistr2( &unistr_guid,
smb_uuid_string(talloc_tos(), guid),
GUID_string(talloc_tos(), &guid),
UNI_STR_TERMINATE );
regval_ctr_addvalue( printer_data->keys[key_index].values,

View File

@ -4373,7 +4373,7 @@ static bool construct_printer_info_7(Printer_entry *print_hnd, PRINTER_INFO_7 *p
if (is_printer_published(print_hnd, snum, &guid)) {
if (asprintf(&guid_str, "{%s}",
smb_uuid_string(talloc_tos(), guid)) == -1) {
GUID_string(talloc_tos(), &guid)) == -1) {
return false;
}
strupper_m(guid_str);

View File

@ -112,8 +112,8 @@ static void display_query_info_12(struct lsa_DnsDomainInfo *r)
d_printf("Domain DNS Name: %s\n", r->dns_domain.string);
d_printf("Domain Forest Name: %s\n", r->dns_forest.string);
d_printf("Domain Sid: %s\n", sid_string_tos(r->sid));
d_printf("Domain GUID: %s\n", smb_uuid_string(talloc_tos(),
r->domain_guid));
d_printf("Domain GUID: %s\n", GUID_string(talloc_tos(),
&r->domain_guid));
}
static void display_lsa_query_info(union lsa_PolicyInformation *info,

View File

@ -67,7 +67,7 @@ static int net_ads_cldap_netlogon(struct net_context *c, ADS_STRUCT *ads)
break;
}
d_printf("GUID: %s\n", smb_uuid_string(talloc_tos(), reply.domain_uuid));
d_printf("GUID: %s\n", GUID_string(talloc_tos(), &reply.domain_uuid));
d_printf("Flags:\n"
"\tIs a PDC: %s\n"