summaryrefslogtreecommitdiffstats
path: root/source3/winbindd/idmap_autorid.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-03-17 12:49:59 +0100
committerMichael Adam <obnox@samba.org>2014-04-25 15:35:09 +0200
commit5d9d4c73d77434d811f8e492c5efc5e7336f30db (patch)
tree6f8f024181599b29d10ad15da73064cc77c2baaa /source3/winbindd/idmap_autorid.c
parent3c706e9f014fa1bd06e80c5c81f321dcf90ff58e (diff)
downloadsamba-5d9d4c73d77434d811f8e492c5efc5e7336f30db.tar.gz
samba-5d9d4c73d77434d811f8e492c5efc5e7336f30db.tar.xz
samba-5d9d4c73d77434d811f8e492c5efc5e7336f30db.zip
autorid: factor idmap_autorid_get_alloc_range() out of idmap_autorid_allocate_id()
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/winbindd/idmap_autorid.c')
-rw-r--r--source3/winbindd/idmap_autorid.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c
index cf82e47fac..8adfab4b20 100644
--- a/source3/winbindd/idmap_autorid.c
+++ b/source3/winbindd/idmap_autorid.c
@@ -87,6 +87,22 @@ static struct db_context *autorid_db;
static bool ignore_builtin = false;
+static NTSTATUS idmap_autorid_get_alloc_range(struct idmap_domain *dom,
+ struct autorid_range_config *range)
+{
+ NTSTATUS status;
+
+ ZERO_STRUCT(*range);
+
+ fstrcpy(range->domsid, ALLOC_RANGE);
+
+ status = idmap_autorid_get_domainrange(autorid_db,
+ range,
+ dom->read_only);
+
+ return status;
+}
+
static NTSTATUS idmap_autorid_allocate_id(struct idmap_domain *dom,
struct unixid *xid) {
@@ -101,12 +117,7 @@ static NTSTATUS idmap_autorid_allocate_id(struct idmap_domain *dom,
/* fetch the range for the allocation pool */
- ZERO_STRUCT(range);
-
- fstrcpy(range.domsid, ALLOC_RANGE);
-
- ret = idmap_autorid_get_domainrange(autorid_db, &range, dom->read_only);
-
+ ret = idmap_autorid_get_alloc_range(dom, &range);
if (!NT_STATUS_IS_OK(ret)) {
DEBUG(3, ("Could not determine range for allocation pool, "
"check previous messages for reason\n"));