diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-02-22 09:28:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:51:59 -0500 |
commit | 98c0767677156ff31791bd93f473ac11f856c75a (patch) | |
tree | 565141973847ef6633f2159bc25d22975a782228 /source4/dsdb/samdb | |
parent | d590dea10b3abf93fcc8138189291e8b66bae7d7 (diff) | |
download | samba-98c0767677156ff31791bd93f473ac11f856c75a.tar.gz samba-98c0767677156ff31791bd93f473ac11f856c75a.tar.bz2 samba-98c0767677156ff31791bd93f473ac11f856c75a.zip |
r13616: Add new ldb functions: ldb_msg_add_steal_string() and
ldb_msg_add_steal_value().
These try to maintain the talloc heirachy, which must be correct
otherwise talloc_steal operations of entire attribute lists fails.
This fixes the currentTime value, found by using Microsoft's dcdiag
tool (before this commit, it pointed to invalid memory, due to the
changes in -r 13606)
Andrew Bartlett
(This used to be commit 424df1bb369fddcfd358cf26dd0da9d3851d181e)
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/rootdse.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c index 96236301b0..07e34f1841 100644 --- a/source4/dsdb/samdb/ldb_modules/rootdse.c +++ b/source4/dsdb/samdb/ldb_modules/rootdse.c @@ -64,8 +64,8 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_request *re msg->dn = ldb_dn_explode(msg, ""); if (do_attribute(s->attrs, "currentTime")) { - if (ldb_msg_add_string(msg, "currentTime", - ldb_timestring(msg, time(NULL))) != 0) { + if (ldb_msg_add_steal_string(msg, "currentTime", + ldb_timestring(msg, time(NULL))) != 0) { goto failed; } } @@ -77,8 +77,8 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_request *re if (!control) { goto failed; } - if (ldb_msg_add_string(msg, "supportedControl", - control) != 0) { + if (ldb_msg_add_steal_string(msg, "supportedControl", + control) != 0) { goto failed; } } @@ -95,12 +95,12 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_request *re int i; for (i = 0; ops && ops[i]; i++) { if (ops[i]->sasl_name) { - const char *sasl_name = talloc_strdup(msg, ops[i]->sasl_name); + char *sasl_name = talloc_strdup(msg, ops[i]->sasl_name); if (!sasl_name) { goto failed; } - if (ldb_msg_add_string(msg, "supportedSASLMechanisms", - sasl_name) != 0) { + if (ldb_msg_add_steal_string(msg, "supportedSASLMechanisms", + sasl_name) != 0) { goto failed; } } |