diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-08-20 15:50:58 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-08-20 15:50:58 +1000 |
commit | f96f623854d3cd8bdaacd25979618f1cb53b8f93 (patch) | |
tree | 6cac92c2fdcc518a02d83cf1d44b5847113e398f /source4/lib/ldb-samba/ldif_handlers.c | |
parent | 7e1c62f8b64c9e42018bea33557af31fb7fa7414 (diff) | |
parent | b33f4541f6157163f9b22af8607ecefe3953638f (diff) | |
download | samba-f96f623854d3cd8bdaacd25979618f1cb53b8f93.tar.gz samba-f96f623854d3cd8bdaacd25979618f1cb53b8f93.tar.bz2 samba-f96f623854d3cd8bdaacd25979618f1cb53b8f93.zip |
Merge commit 'origin/v4-0-test' into v4-0-test
(This used to be commit 3bdc906eb63a494f0d8478c13f8330828aa2f725)
Diffstat (limited to 'source4/lib/ldb-samba/ldif_handlers.c')
-rw-r--r-- | source4/lib/ldb-samba/ldif_handlers.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/source4/lib/ldb-samba/ldif_handlers.c b/source4/lib/ldb-samba/ldif_handlers.c index 1f718cc1c5..22a57da10b 100644 --- a/source4/lib/ldb-samba/ldif_handlers.c +++ b/source4/lib/ldb-samba/ldif_handlers.c @@ -561,8 +561,6 @@ static int ldif_comparison_prefixMap(struct ldb_context *ldb, void *mem_ctx, return ret; } -#define LDB_SYNTAX_SAMBA_SID "LDB_SYNTAX_SAMBA_SID" -#define LDB_SYNTAX_SAMBA_SECURITY_DESCRIPTOR "LDB_SYNTAX_SAMBA_SECURITY_DESCRIPTOR" #define LDB_SYNTAX_SAMBA_GUID "LDB_SYNTAX_SAMBA_GUID" #define LDB_SYNTAX_SAMBA_OBJECT_CATEGORY "LDB_SYNTAX_SAMBA_OBJECT_CATEGORY" #define LDB_SYNTAX_SAMBA_PREFIX_MAP "LDB_SYNTAX_SAMBA_PREFIX_MAP" @@ -635,6 +633,21 @@ static const struct { { "prefixMap", LDB_SYNTAX_SAMBA_PREFIX_MAP } }; +const struct ldb_schema_syntax *ldb_samba_syntax_by_name(struct ldb_context *ldb, const char *name) +{ + uint32_t j; + const struct ldb_schema_syntax *s = NULL; + + for (j=0; j < ARRAY_SIZE(samba_syntaxes); j++) { + if (strcmp(name, samba_syntaxes[j].name) == 0) { + s = &samba_syntaxes[j]; + break; + } + } + return s; +} + + /* register the samba ldif handlers */ @@ -644,15 +657,9 @@ int ldb_register_samba_handlers(struct ldb_context *ldb) for (i=0; i < ARRAY_SIZE(samba_attributes); i++) { int ret; - uint32_t j; const struct ldb_schema_syntax *s = NULL; - for (j=0; j < ARRAY_SIZE(samba_syntaxes); j++) { - if (strcmp(samba_attributes[i].syntax, samba_syntaxes[j].name) == 0) { - s = &samba_syntaxes[j]; - break; - } - } + s = ldb_samba_syntax_by_name(ldb, samba_attributes[i].syntax); if (!s) { s = ldb_standard_syntax_by_name(ldb, samba_attributes[i].syntax); |