summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-09-04 17:43:28 +0200
committerMichael Adam <obnox@samba.org>2013-10-02 00:06:23 +0200
commit4350bfba4624710e66f0d9775d146086054a97cc (patch)
treec565314188e0303079d1553393ec98149808c3cf /source3/winbindd
parent6e08f5a7924fbf55477a1f53a72f23236c01c1d6 (diff)
downloadsamba-4350bfba4624710e66f0d9775d146086054a97cc.tar.gz
samba-4350bfba4624710e66f0d9775d146086054a97cc.tar.bz2
samba-4350bfba4624710e66f0d9775d146086054a97cc.zip
idmap_autorid: add new function idmap_autorid_setrange()
This allows to directly set a range for a domsid#index pair. It fails if a stored range is found which is different from the requested one. Pair-Programmed-With: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/idmap_autorid_tdb.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/winbindd/idmap_autorid_tdb.c b/source3/winbindd/idmap_autorid_tdb.c
index e5fccae551..4220a9c787 100644
--- a/source3/winbindd/idmap_autorid_tdb.c
+++ b/source3/winbindd/idmap_autorid_tdb.c
@@ -232,6 +232,23 @@ static NTSTATUS idmap_autorid_addrange(struct db_context *db,
return status;
}
+NTSTATUS idmap_autorid_setrange(struct db_context *db,
+ const char *domsid,
+ uint32_t domain_range_index,
+ uint32_t rangenum)
+{
+ NTSTATUS status;
+ struct autorid_range_config range;
+
+ ZERO_STRUCT(range);
+ fstrcpy(range.domsid, domsid);
+ range.domain_range_index = domain_range_index;
+ range.rangenum = rangenum;
+
+ status = idmap_autorid_addrange(db, &range, false);
+ return status;
+}
+
static NTSTATUS idmap_autorid_getrange_int(struct db_context *db,
struct autorid_range_config *range)
{