summaryrefslogtreecommitdiffstats
path: root/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-12-23 11:09:04 +0000
committerGünther Deschner <gd@samba.org>2015-01-05 17:01:08 +0100
commit0c9ee5b82f84182fe7c0182257bd8b67cc93ca37 (patch)
treef5f849689367c762b7ce23758b6227d7c5b090b6 /libcli
parentc5948040805f2585dd9da3a6955f605d8d9fa70c (diff)
downloadsamba-0c9ee5b82f84182fe7c0182257bd8b67cc93ca37.tar.gz
samba-0c9ee5b82f84182fe7c0182257bd8b67cc93ca37.tar.xz
samba-0c9ee5b82f84182fe7c0182257bd8b67cc93ca37.zip
libcli/netlogon: We need to handle a bug in FreeIPA (at least <= 4.1.2).
They include the ip address information without setting NETLOGON_NT_VERSION_5EX_WITH_IP, while using ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX instead of ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/netlogon/netlogon.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libcli/netlogon/netlogon.c b/libcli/netlogon/netlogon.c
index d82a2013b8..58a331d70a 100644
--- a/libcli/netlogon/netlogon.c
+++ b/libcli/netlogon/netlogon.c
@@ -91,9 +91,18 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx,
ndr, NDR_SCALARS|NDR_BUFFERS, &response->data.nt5_ex,
ntver);
if (ndr->offset < ndr->data_size) {
- ndr_err = ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES,
- "not all bytes consumed ofs[%u] size[%u]",
- ndr->offset, ndr->data_size);
+ TALLOC_FREE(ndr);
+ /*
+ * We need to handle a bug in FreeIPA (at least <= 4.1.2).
+ *
+ * They include the ip address information without setting
+ * NETLOGON_NT_VERSION_5EX_WITH_IP, while using
+ * ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX instead of
+ * ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags.
+ */
+ ndr_err = ndr_pull_struct_blob_all(data, mem_ctx,
+ &response->data.nt5,
+ (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX);
}
response->ntver = NETLOGON_NT_VERSION_5EX;
if (NDR_ERR_CODE_IS_SUCCESS(ndr_err) && DEBUGLEVEL >= 10) {