summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tools/ad2oLschema.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-08-22 10:49:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:28 -0500
commitb2658f0dd6975758d7a3496e661c2e04f19bf36f (patch)
treede91311bc207d465150fe06fcdeebd9663aa7527 /source4/lib/ldb/tools/ad2oLschema.c
parentb2dd4b3e15cfb71c4f94aa41e7711ae696a12b9a (diff)
downloadsamba-b2658f0dd6975758d7a3496e661c2e04f19bf36f.tar.gz
samba-b2658f0dd6975758d7a3496e661c2e04f19bf36f.tar.bz2
samba-b2658f0dd6975758d7a3496e661c2e04f19bf36f.zip
r17707: Match the output (aside from dividers) the output of
ol-schema-migrate.pl in the schema output. Andrew Bartlett (This used to be commit 8f624fd17503e85afe74a3e1915e30f28d19853b)
Diffstat (limited to 'source4/lib/ldb/tools/ad2oLschema.c')
-rw-r--r--source4/lib/ldb/tools/ad2oLschema.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/source4/lib/ldb/tools/ad2oLschema.c b/source4/lib/ldb/tools/ad2oLschema.c
index ceff7aef6f..9ea63b06f8 100644
--- a/source4/lib/ldb/tools/ad2oLschema.c
+++ b/source4/lib/ldb/tools/ad2oLschema.c
@@ -312,6 +312,14 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum convert_
return ret;
}
+ switch (target) {
+ case TARGET_OPENLDAP:
+ break;
+ case TARGET_FEDORA_DS:
+ fprintf(out, "dn: cn=schema\n");
+ break;
+ }
+
for (i=0; i < attrs_res->count; i++) {
struct ldb_message *msg = attrs_res->msgs[i];
@@ -396,9 +404,16 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum convert_
}
schema_entry = talloc_asprintf_append(schema_entry,
- " )\n\n");
+ " )");
- fprintf(out, "%s", schema_entry);
+ switch (target) {
+ case TARGET_OPENLDAP:
+ fprintf(out, "%s\n\n", schema_entry);
+ break;
+ case TARGET_FEDORA_DS:
+ fprintf(out, "%s\n", schema_entry);
+ break;
+ }
}
ldb_ret = fetch_objectclass_schema(ldb, schemadn, mem_ctx, &objectclasses_res);
@@ -502,7 +517,7 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum convert_
schema_entry = talloc_asprintf_append(schema_entry, \
" $"); \
IF_NULL_FAIL_RET(schema_entry); \
- if ((k+1)%5 == 0) { \
+ if (target == TARGET_OPENLDAP && ((k+1)%5 == 0)) { \
schema_entry = talloc_asprintf_append(schema_entry, \
"\n "); \
IF_NULL_FAIL_RET(schema_entry); \
@@ -524,7 +539,7 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum convert_
APPEND_ATTRS(sys_must);
schema_entry = talloc_asprintf_append(schema_entry,
- ")\n");
+ " )\n");
IF_NULL_FAIL_RET(schema_entry);
}
@@ -546,9 +561,16 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum convert_
}
schema_entry = talloc_asprintf_append(schema_entry,
- " )\n\n");
+ " )");
- fprintf(out, "%s", schema_entry);
+ switch (target) {
+ case TARGET_OPENLDAP:
+ fprintf(out, "%s\n\n", schema_entry);
+ break;
+ case TARGET_FEDORA_DS:
+ fprintf(out, "%s\n", schema_entry);
+ break;
+ }
}
return ret;