[SCM] Samba Shared Repository - branch master updated - 4c81727a003e4c49c314e0c5a1b4584b8825e7fe

Jelmer Vernooij jelmer at samba.org
Tue Oct 14 00:35:14 GMT 2008


The branch, master has been updated
       via  4c81727a003e4c49c314e0c5a1b4584b8825e7fe (commit)
       via  a62c510d8b3f5e15bd48f71747c5f516eca570c7 (commit)
       via  1f3e4f39c5219b8ca3564e0c2eb685d9e7fdb13e (commit)
      from  501fa6a05db1b2c29b1e4720a03ed219aee2a346 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 4c81727a003e4c49c314e0c5a1b4584b8825e7fe
Merge: a62c510d8b3f5e15bd48f71747c5f516eca570c7 501fa6a05db1b2c29b1e4720a03ed219aee2a346
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Oct 14 02:34:38 2008 +0200

    Merge branch 'master' of git://git.samba.org/samba

commit a62c510d8b3f5e15bd48f71747c5f516eca570c7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Oct 14 02:33:41 2008 +0200

    Use GUID_from_string.

commit 1f3e4f39c5219b8ca3564e0c2eb685d9e7fdb13e
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Oct 14 02:26:18 2008 +0200

    Use GUID_string rather than smb_uuid_string().

-----------------------------------------------------------------------

Summary of changes:
 source3/include/proto.h             |    2 -
 source3/lib/display_sec.c           |    8 ++--
 source3/lib/util_uuid.c             |   67 -----------------------------------
 source3/libads/disp_sec.c           |    8 ++--
 source3/libads/ldap.c               |    4 +-
 source3/printing/nt_printing.c      |    6 ++--
 source3/rpc_server/srv_spoolss_nt.c |    2 +-
 source3/rpcclient/cmd_lsarpc.c      |    4 +-
 source3/utils/net_ads.c             |    2 +-
 9 files changed, 17 insertions(+), 86 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 8ccf987..480b3eb 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1763,8 +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);
 
 /* The following definitions come from lib/version.c  */
diff --git a/source3/lib/display_sec.c b/source3/lib/display_sec.c
index 5427a81..a0d93d6 100644
--- a/source3/lib/display_sec.c
+++ b/source3/lib/display_sec.c
@@ -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));
 	}
 }
 
diff --git a/source3/lib/util_uuid.c b/source3/lib/util_uuid.c
index 3a8f7b3..7e67d79 100644
--- a/source3/lib/util_uuid.c
+++ b/source3/lib/util_uuid.c
@@ -20,12 +20,6 @@
 
 #include "includes.h"
 
-/*
- * Offset between 15-Oct-1582 and 1-Jan-70
- */
-#define TIME_OFFSET_HIGH 0x01B21DD2
-#define TIME_OFFSET_LOW  0x13814000
-
 void smb_uuid_pack(const struct GUID uu, UUID_FLAT *ptr)
 {
 	SIVAL(ptr->info, 0, uu.time_low);
@@ -55,67 +49,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;
-	const char *ptr = in;
-	char *end = (char *)in;
-	int i;
-	unsigned v1, v2;
-
-	if (!in || !uu) goto out;
-
-	uu->time_low = strtoul(ptr, &end, 16);
-	if ((end - ptr) != 8 || *end != '-') goto out;
-	ptr = (end + 1);
-
-	uu->time_mid = strtoul(ptr, &end, 16);
-	if ((end - ptr) != 4 || *end != '-') goto out;
-	ptr = (end + 1);
-
-	uu->time_hi_and_version = strtoul(ptr, &end, 16);
-	if ((end - ptr) != 4 || *end != '-') goto out;
-	ptr = (end + 1);
-
-	if (sscanf(ptr, "%02x%02x", &v1, &v2) != 2) {
-		goto out;
-	}
-	uu->clock_seq[0] = v1;
-	uu->clock_seq[1] = v2;
-	ptr += 4;
-
-	if (*ptr != '-') goto out;
-	ptr++;
-
-	for (i = 0; i < 6; i++) {
-		if (sscanf(ptr, "%02x", &v1) != 1) {
-			goto out;
-		}
-		uu->node[i] = v1;
-		ptr += 2;
-	}
-
-	ret = True;
-out:
-        return ret;
-}
-
 /*****************************************************************
  Return the binary string representation of a GUID.
  Caller must free.
diff --git a/source3/libads/disp_sec.c b/source3/libads/disp_sec.c
index f4c6863..a5e04a4 100644
--- a/source3/libads/disp_sec.c
+++ b/source3/libads/disp_sec.c
@@ -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));
 	}
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index fbbe1a5..2dcd1fd 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -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;
 	}
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 85f42fe..c0e62ea 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -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, 
@@ -3536,7 +3536,7 @@ bool is_printer_published(Printer_entry *print_hnd, int snum,
 		case REG_SZ:		
 			rpcstr_pull( guid_str, regval_data_p(guid_val), 
 				     sizeof(guid_str)-1, -1, STR_TERMINATE );
-			ret = smb_string_to_uuid( guid_str, guid );
+			ret = NT_STATUS_IS_OK(GUID_from_string( guid_str, guid ));
 			break;			
 		case REG_BINARY:
 			if ( regval_size(guid_val) != sizeof(struct GUID) ) {
@@ -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, 
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 52cb02b..af9246c 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -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);
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c
index 5b5b4ff..746fc25 100644
--- a/source3/rpcclient/cmd_lsarpc.c
+++ b/source3/rpcclient/cmd_lsarpc.c
@@ -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,
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 30c47dd..8e8dd7e 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -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"


-- 
Samba Shared Repository


More information about the samba-cvs mailing list