From 49dee0e453049a2b26aaacf81e61a0f11afccd91 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 24 Oct 2010 19:30:12 +0200 Subject: 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. --- source4/dsdb/samdb/ldb_modules/rootdse.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source4/dsdb/samdb/ldb_modules/rootdse.c') 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; } } -- cgit