summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-11-14 08:51:59 +0100
committerStefan Metzmacher <metze@samba.org>2008-11-16 16:37:28 +0100
commita1f76f7afef78ecd5bc1b07568011ea1baa03219 (patch)
treeead91b6ba4469c2f9944cbf917a80a09580b578b /source4/dsdb
parent3c0f03ade2862b175dbc147c903b2c6a9bb3c6d2 (diff)
downloadsamba-a1f76f7afef78ecd5bc1b07568011ea1baa03219.tar.gz
samba-a1f76f7afef78ecd5bc1b07568011ea1baa03219.tar.bz2
samba-a1f76f7afef78ecd5bc1b07568011ea1baa03219.zip
s4:dsdb/schema: add a function to generate the "extendedClassInfo" values
metze
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/schema/schema_description.c48
1 files changed, 44 insertions, 4 deletions
diff --git a/source4/dsdb/schema/schema_description.c b/source4/dsdb/schema/schema_description.c
index 754ce43615..9443c04bb0 100644
--- a/source4/dsdb/schema/schema_description.c
+++ b/source4/dsdb/schema/schema_description.c
@@ -216,7 +216,8 @@ char *schema_class_description(TALLOC_CTX *mem_ctx,
const char *subClassOf,
int objectClassCategory,
char **must,
- char **may)
+ char **may,
+ const char *schemaHexGUID)
{
char *schema_entry = talloc_asprintf(mem_ctx,
"(%s%s%s", seperator, oid, seperator);
@@ -299,7 +300,14 @@ char *schema_class_description(TALLOC_CTX *mem_ctx,
")%s", seperator);
IF_NULL_FAIL_RET(schema_entry);
}
-
+
+ if (schemaHexGUID) {
+ schema_entry = talloc_asprintf_append(schema_entry,
+ "CLASS-GUID '%s'%s",
+ schemaHexGUID, seperator);
+ IF_NULL_FAIL_RET(schema_entry);
+ }
+
schema_entry = talloc_asprintf_append(schema_entry,
")");
return schema_entry;
@@ -325,7 +333,8 @@ char *schema_class_to_description(TALLOC_CTX *mem_ctx, const struct dsdb_class *
dsdb_attribute_list(tmp_ctx,
class, DSDB_SCHEMA_ALL_MUST),
dsdb_attribute_list(tmp_ctx,
- class, DSDB_SCHEMA_ALL_MAY));
+ class, DSDB_SCHEMA_ALL_MAY),
+ NULL);
talloc_free(tmp_ctx);
return schema_description;
}
@@ -369,7 +378,38 @@ char *schema_class_to_dITContentRule(TALLOC_CTX *mem_ctx, const struct dsdb_clas
* ditContentRules
* per MS-ADTS
* 3.1.1.3.1.1.1 */
- -1, must_attr_list, may_attr_list);
+ -1, must_attr_list, may_attr_list,
+ NULL);
+ talloc_free(tmp_ctx);
+ return schema_description;
+}
+
+char *schema_class_to_extendedInfo(TALLOC_CTX *mem_ctx, const struct dsdb_class *sclass)
+{
+ char *schema_description = NULL;
+ DATA_BLOB guid_blob;
+ char *guid_hex;
+ TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
+ if (!tmp_ctx) {
+ return NULL;
+ }
+
+ schema_description
+ = schema_class_description(mem_ctx,
+ TARGET_AD_SCHEMA_SUBENTRY,
+ " ",
+ sclass->governsID_oid,
+ sclass->lDAPDisplayName,
+ NULL,
+ NULL, /* Must not specify a
+ * SUP (subclass) in
+ * ditContentRules
+ * per MS-ADTS
+ * 3.1.1.3.1.1.1 */
+ -1, NULL, NULL,
+ GUID_hexstring(tmp_ctx, &sclass->schemaIDGUID));
talloc_free(tmp_ctx);
return schema_description;
}
+
+