mirror of
https://github.com/samba-team/samba.git
synced 2025-01-13 13:18:06 +03:00
r10790: allow updating of existing ldb opaque values (thanks to abartlet for
spotting this)
This commit is contained in:
parent
ebb8e75ebd
commit
ef13569ca9
@ -350,7 +350,17 @@ const char *ldb_errstring(struct ldb_context *ldb)
|
||||
*/
|
||||
int ldb_set_opaque(struct ldb_context *ldb, const char *name, void *value)
|
||||
{
|
||||
struct ldb_opaque *o = talloc(ldb, struct ldb_opaque);
|
||||
struct ldb_opaque *o;
|
||||
|
||||
/* allow updating an existing value */
|
||||
for (o=ldb->opaque;o;o=o->next) {
|
||||
if (strcmp(o->name, name) == 0) {
|
||||
o->value = value;
|
||||
return LDB_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
o = talloc(ldb, struct ldb_opaque);
|
||||
if (o == NULL) {
|
||||
ldb_oom(ldb);
|
||||
return LDB_ERR_OTHER;
|
||||
|
Loading…
Reference in New Issue
Block a user