summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.h2
-rw-r--r--src/db/sysdb_ranges.c16
2 files changed, 18 insertions, 0 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 489188b7f..0b99dee07 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -130,6 +130,7 @@
#define SYSDB_BASE_RID "baseRID"
#define SYSDB_SECONDARY_BASE_RID "secondaryBaseRID"
#define SYSDB_DOMAIN_ID "domainID"
+#define SYSDB_ID_RANGE_TYPE "idRangeType"
#define SYSDB_NEXTID_FILTER "("SYSDB_NEXTID"=*)"
@@ -245,6 +246,7 @@ struct range_info {
uint32_t base_rid;
uint32_t secondary_base_rid;
char *trusted_dom_sid;
+ char *range_type;
};
diff --git a/src/db/sysdb_ranges.c b/src/db/sysdb_ranges.c
index cc72033eb..5b444eac6 100644
--- a/src/db/sysdb_ranges.c
+++ b/src/db/sysdb_ranges.c
@@ -53,6 +53,7 @@ errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
SYSDB_BASE_RID,
SYSDB_SECONDARY_BASE_RID,
SYSDB_DOMAIN_ID,
+ SYSDB_ID_RANGE_TYPE,
NULL};
struct range_info **list;
struct ldb_dn *basedn;
@@ -140,6 +141,17 @@ errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
DEBUG(SSSDBG_MINOR_FAILURE, ("find_attr_as_uint32_t failed.\n"));
goto done;
}
+
+ tmp_str = ldb_msg_find_attr_as_string(res->msgs[c], SYSDB_ID_RANGE_TYPE,
+ NULL);
+ if (tmp_str != NULL) {
+ list[c]->range_type = talloc_strdup(list, tmp_str);
+ if (list[c]->range_type == NULL) {
+ ret = ENOMEM;
+ goto done;
+ }
+ }
+
}
list[res->count] = NULL;
@@ -228,6 +240,10 @@ errno_t sysdb_range_create(struct sysdb_ctx *sysdb, struct range_info *range)
(unsigned long)time(NULL));
if (ret) goto done;
+ ret = add_string(msg, LDB_FLAG_MOD_ADD, SYSDB_ID_RANGE_TYPE,
+ range->range_type);
+ if (ret) goto done;
+
ret = ldb_add(sysdb->ldb, msg);
if (ret) goto done;