From: Andrew Bartlett Date: Fri, 30 Aug 2019 08:38:01 +0000 (+1200) Subject: util: Remove unused NS_GUID_string() and NS_GUID_from_string() X-Git-Tag: tevent-0.10.1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af6799bf4f1509af19c74c300a0d4a889a69cbfe;p=thirdparty%2Fsamba.git util: Remove unused NS_GUID_string() and NS_GUID_from_string() BUG: https://bugzilla.samba.org/show_bug.cgi?id=14063 Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam --- diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 1c71c243ed5..817fce6e17f 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -5264,58 +5264,6 @@ int dsdb_create_partial_replica_NC(struct ldb_context *ldb, struct ldb_dn *dn) return LDB_SUCCESS; } -/** - build a GUID from a string -*/ -_PUBLIC_ NTSTATUS NS_GUID_from_string(const char *s, struct GUID *guid) -{ - NTSTATUS status = NT_STATUS_INVALID_PARAMETER; - uint32_t time_low; - uint32_t time_mid, time_hi_and_version; - uint32_t clock_seq[2]; - uint32_t node[6]; - int i; - - if (s == NULL) { - return NT_STATUS_INVALID_PARAMETER; - } - - status = parse_guid_string(s, - &time_low, - &time_mid, - &time_hi_and_version, - clock_seq, - node); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - guid->time_low = time_low; - guid->time_mid = time_mid; - guid->time_hi_and_version = time_hi_and_version; - guid->clock_seq[0] = clock_seq[0]; - guid->clock_seq[1] = clock_seq[1]; - for (i=0;i<6;i++) { - guid->node[i] = node[i]; - } - - return NT_STATUS_OK; -} - -_PUBLIC_ char *NS_GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid) -{ - return talloc_asprintf(mem_ctx, - "%08x-%04x%04x-%02x%02x%02x%02x-%02x%02x%02x%02x", - guid->time_low, guid->time_mid, - guid->time_hi_and_version, - guid->clock_seq[0], - guid->clock_seq[1], - guid->node[0], guid->node[1], - guid->node[2], guid->node[3], - guid->node[4], guid->node[5]); -} - /* * Return the effective badPwdCount * diff --git a/source4/dsdb/common/util.h b/source4/dsdb/common/util.h index c188c68fc95..e1854644d53 100644 --- a/source4/dsdb/common/util.h +++ b/source4/dsdb/common/util.h @@ -79,9 +79,6 @@ bool is_attr_in_list(const char * const * attrs, const char *attr); struct GUID; -char *NS_GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid); -NTSTATUS NS_GUID_from_string(const char *s, struct GUID *guid); - struct ldb_context; int dsdb_werror_at(struct ldb_context *ldb, int ldb_ecode, WERROR werr,