summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/samdb.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index 68ece6c51d..ed8f5ab88f 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -88,9 +88,11 @@ const char *samdb_search_string_v(struct ldb_context *sam_ldb,
const char *format, va_list ap) _PRINTF_ATTRIBUTE(5,0)
{
int count;
- const char * const attrs[2] = { attr_name, NULL };
+ const char *attrs[2] = { NULL, NULL };
struct ldb_message **res = NULL;
+ attrs[0] = attr_name;
+
count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
if (count > 1) {
DEBUG(1,("samdb: search for %s %s not single valued (count=%d)\n",
@@ -136,9 +138,11 @@ struct dom_sid *samdb_search_dom_sid(struct ldb_context *sam_ldb,
va_list ap;
int count;
struct ldb_message **res;
- const char * const attrs[2] = { attr_name, NULL };
+ const char *attrs[2] = { NULL, NULL };
struct dom_sid *sid;
+ attrs[0] = attr_name;
+
va_start(ap, format);
count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
va_end(ap);
@@ -189,7 +193,9 @@ uint_t samdb_search_uint(struct ldb_context *sam_ldb,
va_list ap;
int count;
struct ldb_message **res;
- const char * const attrs[2] = { attr_name, NULL };
+ const char *attrs[2] = { NULL, NULL };
+
+ attrs[0] = attr_name;
va_start(ap, format);
count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
@@ -215,7 +221,9 @@ int64_t samdb_search_int64(struct ldb_context *sam_ldb,
va_list ap;
int count;
struct ldb_message **res;
- const char * const attrs[2] = { attr_name, NULL };
+ const char *attrs[2] = { NULL, NULL };
+
+ attrs[0] = attr_name;
va_start(ap, format);
count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
@@ -241,9 +249,11 @@ int samdb_search_string_multiple(struct ldb_context *sam_ldb,
{
va_list ap;
int count, i;
- const char * const attrs[2] = { attr_name, NULL };
+ const char *attrs[2] = { NULL, NULL };
struct ldb_message **res = NULL;
+ attrs[0] = attr_name;
+
va_start(ap, format);
count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
va_end(ap);
@@ -852,7 +862,7 @@ int samdb_msg_add_uint(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct
int samdb_msg_add_int64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
const char *attr_name, int64_t v)
{
- const char *s = talloc_asprintf(mem_ctx, "%"PRIi64, v);
+ const char *s = talloc_asprintf(mem_ctx, "%lld", v);
return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, s);
}
@@ -862,7 +872,7 @@ int samdb_msg_add_int64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct
int samdb_msg_add_uint64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
const char *attr_name, uint64_t v)
{
- const char *s = talloc_asprintf(mem_ctx, "%"PRIu64, v);
+ const char *s = talloc_asprintf(mem_ctx, "%llu", v);
return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, s);
}