summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-03-01 19:55:46 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-03-01 19:55:46 +0100
commit94069bd2747a8397308c0b0b384f7bb4edd8f68b (patch)
treeace3c4fa9d0cb134d4e904354bd33b395c1e1289 /source4/dsdb/schema
parentbbe2d30f66ebd8537203870b1225179f03d42744 (diff)
downloadsamba-94069bd2747a8397308c0b0b384f7bb4edd8f68b.tar.gz
samba-94069bd2747a8397308c0b0b384f7bb4edd8f68b.tar.bz2
samba-94069bd2747a8397308c0b0b384f7bb4edd8f68b.zip
s4: Use same function signature for convert_* as s3.
Diffstat (limited to 'source4/dsdb/schema')
-rw-r--r--source4/dsdb/schema/schema_init.c7
-rw-r--r--source4/dsdb/schema/schema_syntax.c24
2 files changed, 12 insertions, 19 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index 0e8ac5e105..fbd8946bb5 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -1186,12 +1186,11 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb
return WERR_INVALID_PARAM; \
} \
if (_a && _a->value_ctr.num_values >= 1) { \
- ssize_t _ret; \
- _ret = convert_string_talloc_convenience(mem_ctx, s->iconv_convenience, CH_UTF16, CH_UNIX, \
+ size_t _ret; \
+ if (!convert_string_talloc_convenience(mem_ctx, s->iconv_convenience, CH_UTF16, CH_UNIX, \
_a->value_ctr.values[0].blob->data, \
_a->value_ctr.values[0].blob->length, \
- (void **)discard_const(&(p)->elem), false); \
- if (_ret == -1) { \
+ (void **)discard_const(&(p)->elem), &_ret, false)) { \
DEBUG(0,("%s: invalid data!\n", attr)); \
dump_data(0, \
_a->value_ctr.values[0].blob->data, \
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index 965b85a13a..27c9a6c4a4 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -779,7 +779,6 @@ static WERROR dsdb_syntax_UNICODE_drsuapi_to_ldb(struct ldb_context *ldb,
W_ERROR_HAVE_NO_MEMORY(out->values);
for (i=0; i < out->num_values; i++) {
- ssize_t ret;
char *str;
if (in->value_ctr.values[i].blob == NULL) {
@@ -790,13 +789,12 @@ static WERROR dsdb_syntax_UNICODE_drsuapi_to_ldb(struct ldb_context *ldb,
return WERR_FOOBAR;
}
- ret = convert_string_talloc_convenience(out->values,
+ if (!convert_string_talloc_convenience(out->values,
schema->iconv_convenience,
CH_UTF16, CH_UNIX,
in->value_ctr.values[i].blob->data,
in->value_ctr.values[i].blob->length,
- (void **)&str, false);
- if (ret == -1) {
+ (void **)&str, NULL, false)) {
return WERR_FOOBAR;
}
@@ -835,11 +833,10 @@ static WERROR dsdb_syntax_UNICODE_ldb_to_drsuapi(struct ldb_context *ldb,
out->value_ctr.values[i].blob = &blobs[i];
- ret = convert_string_talloc_convenience(blobs, schema->iconv_convenience, CH_UNIX, CH_UTF16,
+ if (!convert_string_talloc_convenience(blobs, schema->iconv_convenience, CH_UNIX, CH_UTF16,
in->values[i].data,
in->values[i].length,
- (void **)&blobs[i].data, false);
- if (ret == -1) {
+ (void **)&blobs[i].data, NULL, false)) {
return WERR_FOOBAR;
}
blobs[i].length = ret;
@@ -1145,7 +1142,6 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_drsuapi_to_ldb(struct ldb_context
for (i=0; i < out->num_values; i++) {
uint32_t len;
- ssize_t ret;
char *str;
if (in->value_ctr.values[i].blob == NULL) {
@@ -1162,11 +1158,10 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_drsuapi_to_ldb(struct ldb_context
return WERR_FOOBAR;
}
- ret = convert_string_talloc_convenience(out->values, schema->iconv_convenience, CH_UTF16, CH_UNIX,
+ if (!convert_string_talloc_convenience(out->values, schema->iconv_convenience, CH_UTF16, CH_UNIX,
in->value_ctr.values[i].blob->data+4,
in->value_ctr.values[i].blob->length-4,
- (void **)&str, false);
- if (ret == -1) {
+ (void **)&str, NULL, false)) {
return WERR_FOOBAR;
}
@@ -1202,15 +1197,14 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_ldb_to_drsuapi(struct ldb_context
for (i=0; i < in->num_values; i++) {
uint8_t *data;
- ssize_t ret;
+ size_t ret;
out->value_ctr.values[i].blob = &blobs[i];
- ret = convert_string_talloc_convenience(blobs, schema->iconv_convenience, CH_UNIX, CH_UTF16,
+ if (!convert_string_talloc_convenience(blobs, schema->iconv_convenience, CH_UNIX, CH_UTF16,
in->values[i].data,
in->values[i].length,
- (void **)&data, false);
- if (ret == -1) {
+ (void **)&data, &ret, false)) {
return WERR_FOOBAR;
}