summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/rootdse.c
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-24 19:30:12 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-24 17:57:06 +0000
commit49dee0e453049a2b26aaacf81e61a0f11afccd91 (patch)
tree67cc5d76f097367c1af1fa56a18b6816735f7cb9 /source4/dsdb/samdb/ldb_modules/rootdse.c
parent482c02284068810a57b35a509857fb1273d833b0 (diff)
downloadsamba-49dee0e453049a2b26aaacf81e61a0f11afccd91.tar.gz
samba-49dee0e453049a2b26aaacf81e61a0f11afccd91.tar.bz2
samba-49dee0e453049a2b26aaacf81e61a0f11afccd91.zip
s4:dsdb - use the more safe "samdb_msg_add_(u)int*" calls always where possible
This should prevent all possible integer storage problems in future.
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/rootdse.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/rootdse.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c
index 5c6090fc68..b986f77871 100644
--- a/source4/dsdb/samdb/ldb_modules/rootdse.c
+++ b/source4/dsdb/samdb/ldb_modules/rootdse.c
@@ -373,23 +373,24 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_message *ms
}
if (do_attribute(attrs, "domainFunctionality")) {
- if (ldb_msg_add_fmt(msg, "domainFunctionality",
- "%d", dsdb_functional_level(ldb)) != LDB_SUCCESS) {
+ if (samdb_msg_add_int(ldb, msg, msg, "domainFunctionality",
+ dsdb_functional_level(ldb)) != LDB_SUCCESS) {
goto failed;
}
}
if (do_attribute(attrs, "forestFunctionality")) {
- if (ldb_msg_add_fmt(msg, "forestFunctionality",
- "%d", dsdb_forest_functional_level(ldb)) != LDB_SUCCESS) {
+ if (samdb_msg_add_int(ldb, msg, msg, "forestFunctionality",
+ dsdb_forest_functional_level(ldb)) != LDB_SUCCESS) {
goto failed;
}
}
if (do_attribute(attrs, "domainControllerFunctionality")
&& (val = talloc_get_type(ldb_get_opaque(ldb, "domainControllerFunctionality"), int))) {
- if (ldb_msg_add_fmt(msg, "domainControllerFunctionality",
- "%d", *val) != LDB_SUCCESS) {
+ if (samdb_msg_add_int(ldb, msg, msg,
+ "domainControllerFunctionality",
+ *val) != LDB_SUCCESS) {
goto failed;
}
}