diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-05-20 13:25:06 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:53:50 -0500 |
commit | f0a8f718ff474009300af6746fa0fbb61c649ea9 (patch) | |
tree | 47c1c29215336691e96c2d2526883455f108d585 /source4/lib/ldb/common | |
parent | 0a083d1e08a7f7dfcf8abf5866ceb0eee52509e7 (diff) | |
download | samba-f0a8f718ff474009300af6746fa0fbb61c649ea9.tar.gz samba-f0a8f718ff474009300af6746fa0fbb61c649ea9.tar.bz2 samba-f0a8f718ff474009300af6746fa0fbb61c649ea9.zip |
r792: - changed the ldb ldif_* functions to be in the ldb_ namespace
- added better error reporting in ldbdel
- fixed a bug in handling packing of records which contain elements
with no values (it caused db corruption)
- allow search with "dn" as target attribute
(This used to be commit 36575396234e3d35dbd442c8f1ff54a17ae64e64)
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r-- | source4/lib/ldb/common/ldb_ldif.c | 28 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_parse.c | 1 |
2 files changed, 15 insertions, 14 deletions
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c index 513e2dd365..c120ee5f4e 100644 --- a/source4/lib/ldb/common/ldb_ldif.c +++ b/source4/lib/ldb/common/ldb_ldif.c @@ -196,10 +196,10 @@ static const struct { /* write to ldif, using a caller supplied write method */ -int ldif_write(struct ldb_context *ldb, - int (*fprintf_fn)(void *, const char *, ...), - void *private_data, - const struct ldb_ldif *ldif) +int ldb_ldif_write(struct ldb_context *ldb, + int (*fprintf_fn)(void *, const char *, ...), + void *private_data, + const struct ldb_ldif *ldif) { int i, j; int total=0, ret; @@ -407,7 +407,7 @@ static int next_attr(char **s, const char **attr, struct ldb_val *value) /* free a message from a ldif_read */ -void ldif_read_free(struct ldb_context *ldb, struct ldb_ldif *ldif) +void ldb_ldif_read_free(struct ldb_context *ldb, struct ldb_ldif *ldif) { struct ldb_message *msg = &ldif->msg; int i; @@ -457,8 +457,8 @@ static int msg_add_empty(struct ldb_context *ldb, /* read from a LDIF source, creating a ldb_message */ -struct ldb_ldif *ldif_read(struct ldb_context *ldb, - int (*fgetc_fn)(void *), void *private_data) +struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb, + int (*fgetc_fn)(void *), void *private_data) { struct ldb_ldif *ldif; struct ldb_message *msg; @@ -582,7 +582,7 @@ struct ldb_ldif *ldif_read(struct ldb_context *ldb, return ldif; failed: - if (ldif) ldif_read_free(ldb, ldif); + if (ldif) ldb_ldif_read_free(ldb, ldif); return NULL; } @@ -601,11 +601,11 @@ static int fgetc_file(void *private_data) return fgetc(state->f); } -struct ldb_ldif *ldif_read_file(struct ldb_context *ldb, FILE *f) +struct ldb_ldif *ldb_ldif_read_file(struct ldb_context *ldb, FILE *f) { struct ldif_read_file_state state; state.f = f; - return ldif_read(ldb, fgetc_file, &state); + return ldb_ldif_read(ldb, fgetc_file, &state); } @@ -625,11 +625,11 @@ static int fgetc_string(void *private_data) return EOF; } -struct ldb_ldif *ldif_read_string(struct ldb_context *ldb, const char *s) +struct ldb_ldif *ldb_ldif_read_string(struct ldb_context *ldb, const char *s) { struct ldif_read_string_state state; state.s = s; - return ldif_read(ldb, fgetc_string, &state); + return ldb_ldif_read(ldb, fgetc_string, &state); } @@ -652,9 +652,9 @@ static int fprintf_file(void *private_data, const char *fmt, ...) return ret; } -int ldif_write_file(struct ldb_context *ldb, FILE *f, const struct ldb_ldif *ldif) +int ldb_ldif_write_file(struct ldb_context *ldb, FILE *f, const struct ldb_ldif *ldif) { struct ldif_write_file_state state; state.f = f; - return ldif_write(ldb, fprintf_file, &state, ldif); + return ldb_ldif_write(ldb, fprintf_file, &state, ldif); } diff --git a/source4/lib/ldb/common/ldb_parse.c b/source4/lib/ldb/common/ldb_parse.c index 5d2a42fd20..d61d65548c 100644 --- a/source4/lib/ldb/common/ldb_parse.c +++ b/source4/lib/ldb/common/ldb_parse.c @@ -42,6 +42,7 @@ */ #include "includes.h" +#include "ldb/include/ldb_parse.h" /* |