1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

idmap-autorid: Slightly simplify idmap_autorid_get_domainrange

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
This commit is contained in:
Volker Lendecke 2011-03-08 21:55:58 +01:00
parent 3947845041
commit 5006dcff4e

View File

@ -54,15 +54,12 @@ static NTSTATUS idmap_autorid_get_domainrange(struct db_context *db,
{
NTSTATUS ret;
uint32_t domainnum, hwm;
char *sidstr, *numstr;
fstring sidstr;
char *numstr;
struct autorid_domain_config *cfg;
cfg = (struct autorid_domain_config *)private_data;
sidstr = dom_sid_string(talloc_tos(), &(cfg->sid));
if (!sidstr) {
return NT_STATUS_NO_MEMORY;
}
dom_sid_string_buf(&(cfg->sid), sidstr, sizeof(sidstr));
if (!dbwrap_fetch_uint32(db, sidstr, &domainnum)) {
DEBUG(10, ("Acquiring new range for domain %s\n", sidstr));
@ -120,11 +117,9 @@ static NTSTATUS idmap_autorid_get_domainrange(struct db_context *db,
DEBUG(10, ("Using range #%d for domain %s\n", domainnum, sidstr));
cfg->domainnum = domainnum;
talloc_free(sidstr);
return NT_STATUS_OK;
error:
talloc_free(sidstr);
return ret;
}