From 7963e409cc231922f90f57477c2414674c917bdc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 26 Oct 2018 08:25:14 +0200 Subject: [PATCH] passdb: Use dom_sid_str_buf Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/groupdb/mapping_tdb.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c index 3561057214c..b5b11767f27 100644 --- a/source3/groupdb/mapping_tdb.c +++ b/source3/groupdb/mapping_tdb.c @@ -133,15 +133,10 @@ static bool init_group_mapping(void) static char *group_mapping_key(TALLOC_CTX *mem_ctx, const struct dom_sid *sid) { - char sidstr[DOM_SID_STR_BUFLEN]; - int len; + struct dom_sid_buf sidstr; - len = dom_sid_string_buf(sid, sidstr, sizeof(sidstr)); - if (len >= sizeof(sidstr)) { - return NULL; - } - - return talloc_asprintf(mem_ctx, "%s%s", GROUP_PREFIX, sidstr); + return talloc_asprintf( + mem_ctx, "%s%s", GROUP_PREFIX, dom_sid_str_buf(sid, &sidstr)); } /****************************************************************************