mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
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>
This commit is contained in:
parent
6e08f5a792
commit
4350bfba46
@ -65,6 +65,15 @@ NTSTATUS idmap_autorid_getrange(struct db_context *db,
|
||||
uint32_t *rangenum,
|
||||
uint32_t *low_id);
|
||||
|
||||
/**
|
||||
* Set a range for a domain#index pair to a given
|
||||
* number. Fail if a different range was already stored.
|
||||
*/
|
||||
NTSTATUS idmap_autorid_setrange(struct db_context *db,
|
||||
const char *domsid,
|
||||
uint32_t domain_range_index,
|
||||
uint32_t rangenum);
|
||||
|
||||
NTSTATUS idmap_autorid_init_hwm(struct db_context *db, const char *hwm);
|
||||
|
||||
NTSTATUS idmap_autorid_db_init(const char *path,
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user