From d7bc452a893a77eb21b547cd8cdf8b420c60ab5d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 17 Sep 2010 12:33:44 +1000 Subject: s3: Replace sid_binstring and sid_guidstring with PIDL-based alternatives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reduces the manual marshalling of these structures by removing the duplication here. Andrew Bartlett Signed-off-by: Günther Deschner --- source3/lib/util_sid.c | 20 -------------------- source3/lib/util_uuid.c | 13 ------------- 2 files changed, 33 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index d75c8e2c97..d28333f9da 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -333,26 +333,6 @@ bool non_mappable_sid(struct dom_sid *sid) Caller must free. *****************************************************************/ -char *sid_binstring(TALLOC_CTX *mem_ctx, const struct dom_sid *sid) -{ - uint8_t *buf; - char *s; - int len = ndr_size_dom_sid(sid, 0); - buf = talloc_array(mem_ctx, uint8_t, len); - if (!buf) { - return NULL; - } - sid_linearize((char *)buf, len, sid); - s = binary_string_rfc2254(mem_ctx, buf, len); - TALLOC_FREE(buf); - return s; -} - -/***************************************************************** - Return the binary string representation of a struct dom_sid. - Caller must free. -*****************************************************************/ - char *sid_binstring_hex(const struct dom_sid *sid) { char *buf, *s; diff --git a/source3/lib/util_uuid.c b/source3/lib/util_uuid.c index 656ba2a57c..225ac72c6c 100644 --- a/source3/lib/util_uuid.c +++ b/source3/lib/util_uuid.c @@ -38,16 +38,3 @@ void smb_uuid_unpack(const UUID_FLAT in, struct GUID *uu) memcpy(uu->node, in.info+10, 6); } -/***************************************************************** - Return the binary string representation of a GUID. - Caller must free. -*****************************************************************/ - -char *guid_binstring(TALLOC_CTX *mem_ctx, const struct GUID *guid) -{ - UUID_FLAT guid_flat; - - smb_uuid_pack(*guid, &guid_flat); - - return binary_string_rfc2254(mem_ctx, guid_flat.info, UUID_FLAT_SIZE); -} -- cgit