diff options
author | Simo Sorce <idra@samba.org> | 2006-11-22 02:05:19 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:28:22 -0500 |
commit | a9e31b33b55a873c2f01db5e348560176adf863d (patch) | |
tree | 603f4cb99999eea881f6092fb6cbbbcb8daca184 /source4/lib/ldb/ldb_sqlite3 | |
parent | 4889eb9f7aae9349e426d0f6d2217adff67eaebd (diff) | |
download | samba-a9e31b33b55a873c2f01db5e348560176adf863d.tar.gz samba-a9e31b33b55a873c2f01db5e348560176adf863d.tar.bz2 samba-a9e31b33b55a873c2f01db5e348560176adf863d.zip |
r19832: better prototypes for the linearization functions:
- ldb_dn_get_linearized
returns a const string
- ldb_dn_alloc_linearized
allocs astring with the linearized dn
(This used to be commit 3929c086d5d0b3f08b1c4f2f3f9602c3f4a9a4bd)
Diffstat (limited to 'source4/lib/ldb/ldb_sqlite3')
-rw-r--r-- | source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c index 7671b0d954..4ea2eccded 100644 --- a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c +++ b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c @@ -369,8 +369,8 @@ static char *parsetree_to_sql(struct ldb_module *module, } else if (strcasecmp(t->u.equality.attr, "dn") == 0) { /* DN query is a special ldb case */ - char *cdn = ldb_dn_casefold(mem_ctx, - ldb_dn_new(mem_ctx, module->ldb, + const char *cdn = ldb_dn_get_casefold( + ldb_dn_new(mem_ctx, module->ldb, (const char *)value.data)); return lsqlite3_tprintf(mem_ctx, @@ -828,7 +828,7 @@ static long long lsqlite3_get_eid(struct ldb_module *module, struct ldb_dn *dn) return -1; } - cdn = ldb_dn_linearize(local_ctx, ldb_dn_casefold(module->ldb, local_ctx, dn)); + cdn = ldb_dn_alloc_casefold(local_ctx, dn); if (!cdn) goto done; eid = lsqlite3_get_eid_ndn(lsqlite3->sqlite, local_ctx, cdn); @@ -865,7 +865,7 @@ int lsql_search(struct ldb_module *module, struct ldb_request *req) return LDB_ERR_OPERATIONS_ERROR; if (req->op.search.base) { - norm_basedn = ldb_dn_linearize(lsql_ac, ldb_dn_casefold(module->ldb, lsql_ac, req->op.search.base)); + norm_basedn = ldb_dn_alloc_casefold(lsql_ac, req->op.search.base); if (norm_basedn == NULL) { ret = LDB_ERR_INVALID_DN_SYNTAX; goto failed; @@ -1064,8 +1064,8 @@ static int lsql_add(struct ldb_module *module, struct ldb_request *req) } /* create linearized and normalized dns */ - dn = ldb_dn_linearize(lsql_ac, msg->dn); - ndn = ldb_dn_linearize(lsql_ac, ldb_dn_casefold(module->ldb, lsql_ac, msg->dn)); + dn = ldb_dn_alloc_linearized(lsql_ac, msg->dn); + ndn = ldb_dn_alloc_casefold(lsql_ac, msg->dn); if (dn == NULL || ndn == NULL) { ret = LDB_ERR_OTHER; goto done; @@ -1426,9 +1426,9 @@ static int lsql_rename(struct ldb_module *module, struct ldb_request *req) req->handle->status = LDB_SUCCESS; /* create linearized and normalized dns */ - old_cdn = ldb_dn_linearize(lsql_ac, ldb_dn_casefold(module->ldb, lsql_ac, req->op.rename.olddn)); - new_cdn = ldb_dn_linearize(lsql_ac, ldb_dn_casefold(module->ldb, lsql_ac, req->op.rename.newdn)); - new_dn = ldb_dn_linearize(lsql_ac, req->op.rename.newdn); + old_cdn = ldb_dn_alloc_casefold(lsql_ac, req->op.rename.olddn); + new_cdn = ldb_dn_alloc_casefold(lsql_ac, req->op.rename.newdn); + new_dn = ldb_dn_alloc_linearized(lsql_ac, req->op.rename.newdn); if (old_cdn == NULL || new_cdn == NULL || new_dn == NULL) { goto done; } |