summaryrefslogtreecommitdiffstats
path: root/source3/passdb/secrets.c
diff options
context:
space:
mode:
authorTim Prouty <tim.prouty@isilon.com>2008-04-29 14:36:24 -0700
committerVolker Lendecke <vl@samba.org>2008-05-20 22:40:13 +0200
commitfb37f156009611af0dd454a0fb0829a09cd638ac (patch)
treee97403a13dd39b7ef485d36c6c7856045e6e4bf3 /source3/passdb/secrets.c
parent6ed27edbcd3ba1893636a8072c8d7a621437daf7 (diff)
downloadsamba-fb37f156009611af0dd454a0fb0829a09cd638ac.tar.gz
samba-fb37f156009611af0dd454a0fb0829a09cd638ac.tar.xz
samba-fb37f156009611af0dd454a0fb0829a09cd638ac.zip
Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup functions in charcnv.c returning size_t == -1 to indicate failure. (This used to be commit 6b189dabc562d86dcaa685419d0cb6ea276f100d)
Diffstat (limited to 'source3/passdb/secrets.c')
-rw-r--r--source3/passdb/secrets.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index 34a87bd0d0e..a7223b7e9f1 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -685,6 +685,7 @@ bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
{
smb_ucs2_t *uni_dom_name;
bool ret;
+ size_t converted_size;
/* packing structures */
uint8 *pass_buf = NULL;
@@ -693,7 +694,7 @@ bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
struct trusted_dom_pass pass;
ZERO_STRUCT(pass);
- if (push_ucs2_allocate(&uni_dom_name, domain) == (size_t)-1) {
+ if (!push_ucs2_allocate(&uni_dom_name, domain, &converted_size)) {
DEBUG(0, ("Could not convert domain name %s to unicode\n",
domain));
return False;
@@ -926,7 +927,7 @@ struct list_trusted_domains_state {
static int list_trusted_domain(struct db_record *rec, void *private_data)
{
const size_t prefix_len = strlen(SECRETS_DOMTRUST_ACCT_PASS);
- size_t packed_size = 0;
+ size_t converted_size, packed_size = 0;
struct trusted_dom_pass pass;
struct trustdom_info *dom_info;
@@ -960,8 +961,8 @@ static int list_trusted_domain(struct db_record *rec, void *private_data)
return 0;
}
- if (pull_ucs2_talloc(dom_info, &dom_info->name,
- pass.uni_name) == (size_t)-1) {
+ if (!pull_ucs2_talloc(dom_info, &dom_info->name, pass.uni_name,
+ &converted_size)) {
DEBUG(2, ("pull_ucs2_talloc failed\n"));
TALLOC_FREE(dom_info);
return 0;