mirror of
https://github.com/samba-team/samba.git
synced 2025-02-05 21:57:51 +03:00
r8342: allow ldb_ldif_read_string() to continue in the string, so you can
read multiple records
This commit is contained in:
parent
bdc6b67eb2
commit
4b11c00421
@ -99,7 +99,7 @@ int gendb_add_ldif(struct ldb_context *ldb, const char *ldif_string)
|
||||
{
|
||||
struct ldb_ldif *ldif;
|
||||
int ret;
|
||||
ldif = ldb_ldif_read_string(ldb, ldif_string);
|
||||
ldif = ldb_ldif_read_string(ldb, &ldif_string);
|
||||
if (ldif == NULL) return -1;
|
||||
ret = ldb_add(ldb, ldif->msg);
|
||||
talloc_free(ldif);
|
||||
|
@ -728,11 +728,14 @@ static int fgetc_string(void *private_data)
|
||||
return EOF;
|
||||
}
|
||||
|
||||
struct ldb_ldif *ldb_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 ldb_ldif_read(ldb, fgetc_string, &state);
|
||||
struct ldb_ldif *ldif;
|
||||
state.s = *s;
|
||||
ldif = ldb_ldif_read(ldb, fgetc_string, &state);
|
||||
*s = state.s;
|
||||
return ldif;
|
||||
}
|
||||
|
||||
|
||||
|
@ -316,7 +316,7 @@ void ldb_ldif_read_free(struct ldb_context *ldb, struct ldb_ldif *);
|
||||
struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
|
||||
int (*fgetc_fn)(void *), void *private_data);
|
||||
struct ldb_ldif *ldb_ldif_read_file(struct ldb_context *ldb, FILE *f);
|
||||
struct ldb_ldif *ldb_ldif_read_string(struct ldb_context *ldb, const char *s);
|
||||
struct ldb_ldif *ldb_ldif_read_string(struct ldb_context *ldb, const char **s);
|
||||
int ldb_ldif_write_file(struct ldb_context *ldb, FILE *f, const struct ldb_ldif *msg);
|
||||
char *ldb_base64_encode(void *mem_ctx, const char *buf, int len);
|
||||
int ldb_base64_decode(char *s);
|
||||
|
Loading…
x
Reference in New Issue
Block a user