From d862fc6fc65f1fb5ff0582e3561a7ab988af9432 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Tue, 23 Jul 2013 21:08:56 +0300 Subject: WIP compat plugin: solve deadlock when looking up SSSD users --- src/format.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/format.c') diff --git a/src/format.c b/src/format.c index 9ee2444..fbbfb7d 100644 --- a/src/format.c +++ b/src/format.c @@ -103,6 +103,18 @@ xmemdup(char *region, int size) return ret; } +/* returns a berval value as a null terminated string */ +char * +format_strdupbv(struct berval *bv) +{ + char *str = slapi_ch_malloc(bv->bv_len+1); + if (str != NULL) { + memcpy(str, bv->bv_val, bv->bv_len); + str[bv->bv_len] = 0; + } + return str; +} + /* Maintain a DN list, which is list of distinguished names, and a sorted copy * which we can check for inclusion much faster. */ static int -- cgit