summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-03-11 16:55:57 +0100
committerAndrew Bartlett <abartlet@samba.org>2019-03-12 00:42:19 +0000
commite18610a197aab80a32cae8c1e09b96496679bbad (patch)
tree2868943bc213731d1c8c6ff4afbb1120bf35873d /source3/torture
parenta27c39c2c9fd3161f5bf3ae5dba687c8d49519ef (diff)
downloadsamba-e18610a197aab80a32cae8c1e09b96496679bbad.tar.gz
lib: Make sid_parse return the parsed length
Use a temporary struct as a return value to make the compiler catch all callers. If we just changed bool->ssize_t, this would just generate a warning. struct sid_parse_ret will go away in the next commit Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 3df5e409c57..7a209859b3f 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -10878,6 +10878,7 @@ static bool run_local_sid_to_string(int dummy) {
}
static bool run_local_binary_to_sid(int dummy) {
+ struct sid_parse_ret ret;
struct dom_sid *sid = talloc(NULL, struct dom_sid);
static const uint8_t good_binary_sid[] = {
0x1, /* revision number */
@@ -10962,13 +10963,16 @@ static bool run_local_binary_to_sid(int dummy) {
0x1, 0x1, 0x1, 0x1, /* auth[31] */
};
- if (!sid_parse(good_binary_sid, sizeof(good_binary_sid), sid)) {
+ ret = sid_parse(good_binary_sid, sizeof(good_binary_sid), sid);
+ if (ret.len == -1) {
return false;
}
- if (sid_parse(long_binary_sid2, sizeof(long_binary_sid2), sid)) {
+ ret = sid_parse(long_binary_sid2, sizeof(long_binary_sid2), sid);
+ if (ret.len != -1) {
return false;
}
- if (sid_parse(long_binary_sid, sizeof(long_binary_sid), sid)) {
+ ret = sid_parse(long_binary_sid, sizeof(long_binary_sid), sid);
+ if (ret.len != -1) {
return false;
}
return true;