mirror of
https://github.com/samba-team/samba.git
synced 2025-01-14 19:24:43 +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:
parent
3947845041
commit
5006dcff4e
@ -54,15 +54,12 @@ static NTSTATUS idmap_autorid_get_domainrange(struct db_context *db,
|
|||||||
{
|
{
|
||||||
NTSTATUS ret;
|
NTSTATUS ret;
|
||||||
uint32_t domainnum, hwm;
|
uint32_t domainnum, hwm;
|
||||||
char *sidstr, *numstr;
|
fstring sidstr;
|
||||||
|
char *numstr;
|
||||||
struct autorid_domain_config *cfg;
|
struct autorid_domain_config *cfg;
|
||||||
|
|
||||||
cfg = (struct autorid_domain_config *)private_data;
|
cfg = (struct autorid_domain_config *)private_data;
|
||||||
sidstr = dom_sid_string(talloc_tos(), &(cfg->sid));
|
dom_sid_string_buf(&(cfg->sid), sidstr, sizeof(sidstr));
|
||||||
|
|
||||||
if (!sidstr) {
|
|
||||||
return NT_STATUS_NO_MEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dbwrap_fetch_uint32(db, sidstr, &domainnum)) {
|
if (!dbwrap_fetch_uint32(db, sidstr, &domainnum)) {
|
||||||
DEBUG(10, ("Acquiring new range for domain %s\n", sidstr));
|
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));
|
DEBUG(10, ("Using range #%d for domain %s\n", domainnum, sidstr));
|
||||||
cfg->domainnum = domainnum;
|
cfg->domainnum = domainnum;
|
||||||
|
|
||||||
talloc_free(sidstr);
|
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
talloc_free(sidstr);
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user