From: Volker Lendecke Date: Sat, 12 Feb 2011 15:58:10 +0000 (+0100) Subject: s3: Add an explicit counter to tldap_add_mod_[blobs|str] X-Git-Tag: tevent-0.9.11~704 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=84abb428f640e4c48a7231ed78383b197ed715a9;p=thirdparty%2Fsamba.git s3: Add an explicit counter to tldap_add_mod_[blobs|str] --- diff --git a/source3/include/tldap_util.h b/source3/include/tldap_util.h index d0268fe1d62..6a99a5f78a8 100644 --- a/source3/include/tldap_util.h +++ b/source3/include/tldap_util.h @@ -33,10 +33,12 @@ bool tldap_pull_binsid(struct tldap_message *msg, const char *attribute, struct dom_sid *sid); bool tldap_pull_guid(struct tldap_message *msg, const char *attribute, struct GUID *guid); -bool tldap_add_mod_blobs(TALLOC_CTX *mem_ctx, struct tldap_mod **pmods, +bool tldap_add_mod_blobs(TALLOC_CTX *mem_ctx, + struct tldap_mod **pmods, int *pnum_mods, int mod_op, const char *attrib, - DATA_BLOB *values, int num_values); -bool tldap_add_mod_str(TALLOC_CTX *mem_ctx, struct tldap_mod **pmods, + DATA_BLOB *newvals, int num_newvals); +bool tldap_add_mod_str(TALLOC_CTX *mem_ctx, + struct tldap_mod **pmods, int *pnum_mods, int mod_op, const char *attrib, const char *str); bool tldap_make_mod_blob(struct tldap_message *existing, TALLOC_CTX *mem_ctx, struct tldap_mod **pmods, int *pnum_mods, diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c index 2646348aa1f..e42188a2abb 100644 --- a/source3/lib/tldap_util.c +++ b/source3/lib/tldap_util.c @@ -132,7 +132,7 @@ static bool tldap_add_blob_vals(TALLOC_CTX *mem_ctx, struct tldap_mod *mod, } bool tldap_add_mod_blobs(TALLOC_CTX *mem_ctx, - struct tldap_mod **pmods, + struct tldap_mod **pmods, int *pnum_mods, int mod_op, const char *attrib, DATA_BLOB *newvals, int num_newvals) { @@ -148,7 +148,7 @@ bool tldap_add_mod_blobs(TALLOC_CTX *mem_ctx, return false; } - num_mods = talloc_array_length(mods); + num_mods = *pnum_mods; for (i=0; i