summaryrefslogtreecommitdiff
path: root/source3/lib
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/lib
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/lib')
-rw-r--r--source3/lib/smbldap.c4
-rw-r--r--source3/lib/tldap_util.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index 5a67ab79058..cdd350fffa1 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -278,7 +278,7 @@ void smbldap_set_bind_callback(struct smbldap_state *state,
struct dom_sid *sid)
{
DATA_BLOB blob;
- bool ret;
+ struct sid_parse_ret ret;
if (!smbldap_talloc_single_blob(talloc_tos(), ld, msg, attrib,
&blob)) {
@@ -286,7 +286,7 @@ void smbldap_set_bind_callback(struct smbldap_state *state,
}
ret = sid_parse(blob.data, blob.length, sid);
TALLOC_FREE(blob.data);
- return ret;
+ return (ret.len != -1);
}
static int ldapmsg_destructor(LDAPMessage **result) {
diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c
index 3938fca901f..efc37e48e7c 100644
--- a/source3/lib/tldap_util.c
+++ b/source3/lib/tldap_util.c
@@ -88,11 +88,13 @@ bool tldap_pull_binsid(struct tldap_message *msg, const char *attribute,
struct dom_sid *sid)
{
DATA_BLOB val;
+ struct sid_parse_ret ret;
if (!tldap_get_single_valueblob(msg, attribute, &val)) {
return false;
}
- return sid_parse(val.data, val.length, sid);
+ ret = sid_parse(val.data, val.length, sid);
+ return (ret.len != -1);
}
bool tldap_pull_guid(struct tldap_message *msg, const char *attribute,