summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-08-21 17:20:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:16 -0500
commit894a1ed5ae01a54c79b8bc8510e9a7d6090cd90d (patch)
tree103f66059423f307222d52c3a608509b70b91268
parent70ca8615387835f60e9533dd397f10369087157f (diff)
downloadsamba-894a1ed5ae01a54c79b8bc8510e9a7d6090cd90d.tar.gz
samba-894a1ed5ae01a54c79b8bc8510e9a7d6090cd90d.tar.bz2
samba-894a1ed5ae01a54c79b8bc8510e9a7d6090cd90d.zip
r9451: some fixes now core.schema and cosine.schema are also read properly
(This used to be commit 0a26ee04322a06069be48dbc33307e4997700f74)
-rw-r--r--source4/lib/ldb/tools/oLschema2ldif.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/source4/lib/ldb/tools/oLschema2ldif.c b/source4/lib/ldb/tools/oLschema2ldif.c
index c24d160c3a..0a88ba6b71 100644
--- a/source4/lib/ldb/tools/oLschema2ldif.c
+++ b/source4/lib/ldb/tools/oLschema2ldif.c
@@ -53,9 +53,10 @@
#define SCHEMA_MAY 7
#define SCHEMA_SINGLE_VALUE 8
#define SCHEMA_EQUALITY 9
-#define SCHEMA_SUBSTR 10
-#define SCHEMA_SYNTAX 11
-#define SCHEMA_DESC 12
+#define SCHEMA_ORDERING 10
+#define SCHEMA_SUBSTR 11
+#define SCHEMA_SYNTAX 12
+#define SCHEMA_DESC 13
struct schema_conv {
@@ -181,7 +182,15 @@ static struct token *get_next_schema_token(TALLOC_CTX *ctx, char **string)
talloc_free(type);
token->type = SCHEMA_SUP;
- token->value = get_def_value(ctx, &c);
+ if (*c == '(') {
+ c++;
+ n = strcspn(c, ")");
+ token->value = talloc_strndup(ctx, c, n);
+ c += n;
+ c++;
+ } else {
+ token->value = get_def_value(ctx, &c);
+ }
c = skip_spaces(c);
*string = c;
@@ -265,6 +274,17 @@ static struct token *get_next_schema_token(TALLOC_CTX *ctx, char **string)
return token;
}
+ if (strcasecmp("ORDERING", type) == 0) {
+ talloc_free(type);
+ token->type = SCHEMA_ORDERING;
+
+ token->value = get_def_value(ctx, &c);
+
+ c = skip_spaces(c);
+ *string = c;
+ return token;
+ }
+
if (strcasecmp("SUBSTR", type) == 0) {
talloc_free(type);
token->type = SCHEMA_SUBSTR;
@@ -381,7 +401,7 @@ static struct ldb_message *process_entry(TALLOC_CTX *mem_ctx, const char *entry)
break;
case SCHEMA_SUP:
- MSG_ADD_STRING("subClassOf", token->value);
+ MSG_ADD_M_STRING("subClassOf", token->value);
break;
case SCHEMA_STRUCTURAL:
@@ -412,6 +432,10 @@ static struct ldb_message *process_entry(TALLOC_CTX *mem_ctx, const char *entry)
/* TODO */
break;
+ case SCHEMA_ORDERING:
+ /* TODO */
+ break;
+
case SCHEMA_SUBSTR:
/* TODO */
break;