diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-10-12 06:10:23 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:39:41 -0500 |
commit | a599edf04cbdeef9014923ba0d3713b8ff84f266 (patch) | |
tree | 3754385df962fd26fe8bd0e16f3c3b706a385c24 /source4/dsdb/samdb/samdb.c | |
parent | 655138602c75925a6d655841ee80cf5346a9a399 (diff) | |
download | samba-a599edf04cbdeef9014923ba0d3713b8ff84f266.tar.gz samba-a599edf04cbdeef9014923ba0d3713b8ff84f266.tar.bz2 samba-a599edf04cbdeef9014923ba0d3713b8ff84f266.zip |
r10913: This patch isn't as big as it looks ...
most of the changes are fixes to make all the ldb code compile without
warnings on gcc4. Unfortunately That required a lot of casts :-(
I have also added the start of an 'operational' module, which will
replace the timestamp module, plus add support for some other
operational attributes
In ldb_msg_*() I added some new utility functions to make the
operational module sane, and remove the 'ldb' argument from the
ldb_msg_add_*() functions. That argument was only needed back in the
early days of ldb when we didn't use the hierarchical talloc and thus
needed a place to get the allocation function from. Now its just a
pain to pass around everywhere.
Also added a ldb_debug_set() function that calls ldb_debug() plus sets
the result using ldb_set_errstring(). That saves on some awkward
coding in a few places.
(This used to be commit f6818daecca95760c12f79fd307770cbe3346f57)
Diffstat (limited to 'source4/dsdb/samdb/samdb.c')
-rw-r--r-- | source4/dsdb/samdb/samdb.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c index bc8dcd0f06..6afa83e1aa 100644 --- a/source4/dsdb/samdb/samdb.c +++ b/source4/dsdb/samdb/samdb.c @@ -699,7 +699,7 @@ int samdb_msg_add_string(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struc if (s == NULL || a == NULL) { return -1; } - return ldb_msg_add_string(sam_ldb, msg, a, s); + return ldb_msg_add_string(msg, a, s); } /* @@ -715,7 +715,7 @@ int samdb_msg_add_dom_sid(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, stru if (!NT_STATUS_IS_OK(status)) { return -1; } - return ldb_msg_add_value(sam_ldb, msg, attr_name, &v); + return ldb_msg_add_value(msg, attr_name, &v); } @@ -731,7 +731,7 @@ int samdb_msg_add_delete(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struc } /* we use an empty replace rather than a delete, as it allows for samdb_replace() to be used everywhere */ - return ldb_msg_add_empty(sam_ldb, msg, a, LDB_FLAG_MOD_REPLACE); + return ldb_msg_add_empty(msg, a, LDB_FLAG_MOD_REPLACE); } /* @@ -749,7 +749,7 @@ int samdb_msg_add_addval(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struc v = talloc_strdup(mem_ctx, value); if (v == NULL) return -1; - ret = ldb_msg_add_string(sam_ldb, msg, a, v); + ret = ldb_msg_add_string(msg, a, v); if (ret != 0) return ret; el = ldb_msg_find_element(msg, a); @@ -774,7 +774,7 @@ int samdb_msg_add_delval(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struc v = talloc_strdup(mem_ctx, value); if (v == NULL) return -1; - ret = ldb_msg_add_string(sam_ldb, msg, a, v); + ret = ldb_msg_add_string(msg, a, v); if (ret != 0) return ret; el = ldb_msg_find_element(msg, a); @@ -826,7 +826,7 @@ int samdb_msg_add_hash(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct return -1; } val.length = 16; - return ldb_msg_add_value(sam_ldb, msg, attr_name, &val); + return ldb_msg_add_value(msg, attr_name, &val); } /* @@ -845,7 +845,7 @@ int samdb_msg_add_hashes(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struc for (i=0;i<count;i++) { memcpy(i*16 + (char *)val.data, hashes[i].hash, 16); } - return ldb_msg_add_value(sam_ldb, msg, attr_name, &val); + return ldb_msg_add_value(msg, attr_name, &val); } /* @@ -866,7 +866,7 @@ int samdb_msg_add_logon_hours(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_val val; val.length = hours->units_per_week / 8; val.data = hours->bits; - return ldb_msg_add_value(sam_ldb, msg, attr_name, &val); + return ldb_msg_add_value(msg, attr_name, &val); } /* @@ -875,7 +875,7 @@ int samdb_msg_add_logon_hours(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, int samdb_msg_add_value(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg, const char *attr_name, const struct ldb_val *val) { - return ldb_msg_add_value(sam_ldb, msg, attr_name, val); + return ldb_msg_add_value(msg, attr_name, val); } /* @@ -890,7 +890,7 @@ int samdb_msg_set_value(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct if (el) { el->num_values = 0; } - return ldb_msg_add_value(sam_ldb, msg, attr_name, val); + return ldb_msg_add_value(msg, attr_name, val); } /* |