1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

idmap_autorid: add idmap_autorid_build_keystr_talloc()

talloc version of idmap_autorid_build_keystr()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Michael Adam 2013-09-15 11:58:02 +02:00
parent 6d8cc47039
commit 9b7f9f90d2

View File

@ -42,6 +42,23 @@ static void idmap_autorid_build_keystr(const char *domsid,
}
}
static char *idmap_autorid_build_keystr_talloc(TALLOC_CTX *mem_ctx,
const char *domsid,
uint32_t domain_range_index)
{
char *keystr;
if (domain_range_index > 0) {
keystr = talloc_asprintf(mem_ctx, "%s#%"PRIu32, domsid,
domain_range_index);
} else {
keystr = talloc_strdup(mem_ctx, domsid);
}
return keystr;
}
static bool idmap_autorid_validate_sid(const char *sid)
{
struct dom_sid ignore;