summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-09-11 01:04:13 +0200
committerMichael Adam <obnox@samba.org>2013-10-02 00:06:22 +0200
commit69dbc1577b113918e0ac7ffbfcfa1b54f51daf71 (patch)
tree08d83f6e88c20902b3ca71910d3e1f42a689ef04
parente598ed1698c1c2e23cae7c2eecb56e973e6cf5f7 (diff)
downloadsamba-69dbc1577b113918e0ac7ffbfcfa1b54f51daf71.tar.gz
samba-69dbc1577b113918e0ac7ffbfcfa1b54f51daf71.tar.bz2
samba-69dbc1577b113918e0ac7ffbfcfa1b54f51daf71.zip
idmap_autorid: add idmap_autorid_getrange()
Wrapper to idmap_autorid_getrange_int(). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r--source3/include/idmap_autorid_tdb.h10
-rw-r--r--source3/winbindd/idmap_autorid_tdb.c31
2 files changed, 41 insertions, 0 deletions
diff --git a/source3/include/idmap_autorid_tdb.h b/source3/include/idmap_autorid_tdb.h
index f39062f0e4..6ac56b31b9 100644
--- a/source3/include/idmap_autorid_tdb.h
+++ b/source3/include/idmap_autorid_tdb.h
@@ -55,6 +55,16 @@ NTSTATUS idmap_autorid_get_domainrange(struct db_context *db,
struct autorid_range_config *range,
bool read_only);
+/**
+ * get the domain range and low_id for the domain
+ * identified by domsid and domain_range_index
+ */
+NTSTATUS idmap_autorid_getrange(struct db_context *db,
+ const char *domsid,
+ uint32_t domain_range_index,
+ uint32_t *rangenum,
+ uint32_t *low_id);
+
NTSTATUS idmap_autorid_init_hwm(struct db_context *db, const char *hwm);
NTSTATUS idmap_autorid_db_init(const char *path,
diff --git a/source3/winbindd/idmap_autorid_tdb.c b/source3/winbindd/idmap_autorid_tdb.c
index cb45e83814..02ddbaf51a 100644
--- a/source3/winbindd/idmap_autorid_tdb.c
+++ b/source3/winbindd/idmap_autorid_tdb.c
@@ -174,6 +174,37 @@ done:
return status;
}
+NTSTATUS idmap_autorid_getrange(struct db_context *db,
+ const char *domsid,
+ uint32_t domain_range_index,
+ uint32_t *rangenum,
+ uint32_t *low_id)
+{
+ NTSTATUS status;
+ struct autorid_range_config range;
+
+ if (rangenum == NULL) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ ZERO_STRUCT(range);
+ fstrcpy(range.domsid, domsid);
+ range.domain_range_index = domain_range_index;
+
+ status = idmap_autorid_getrange_int(db, &range);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ *rangenum = range.rangenum;
+
+ if (low_id != NULL) {
+ *low_id = range.low_id;
+ }
+
+ return NT_STATUS_OK;
+}
+
NTSTATUS idmap_autorid_get_domainrange(struct db_context *db,
struct autorid_range_config *range,
bool read_only)