1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/python
Tim Beale 2229f4620d drs_utils: Avoid invalid dereference of v8 requests
req.more_flags only exists for v10 requests, so we throw an exception if
we try to dereference that field on a v8 (or v5) request. Unfortunately,
we were checking that we support v10 *after* we had tried to access the
more_flags. This patch fixes up the order of the checks.

This may be a problem trying to replicate with an older Windows DC
(pre-2008R2), and was reported on the samba mailing-list at one point:
https://lists.samba.org/archive/samba/2018-June/216541.html

Unfortunately this patch doesn't help the overall situation at all (the
join will fail because we can't resolve the link target and we can't use
GET_TGT). But it now gives you a more meaningful error, i.e.

  ERROR(runtime): uncaught exception - (8639, "Failed to process 'chunk'
    of DRS replicated objects: DOS code 0x000021bf"
instead of:
  ERROR(<type 'exceptions.AttributeError'>): uncaught exception -
    'drsuapi.DsGetNCChangesRequest8' object has no attribute 'more_flags'

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Tim Beale <timbeale@samba.org>
Autobuild-Date(master): Tue Nov  6 07:15:33 CET 2018 on sn-devel-144
2018-11-06 07:15:33 +01:00
..
examples PEP8: fix W291: trailing whitespace 2018-08-24 07:49:31 +02:00
samba drs_utils: Avoid invalid dereference of v8 requests 2018-11-06 07:15:33 +01:00
samba_external Move python modules from source4/scripting/python/ to python/. 2013-03-02 03:57:34 +01:00
modules.c python: Port simple libpython module to Python 3 compatible form 2017-06-13 22:46:14 +02:00
modules.h Move python modules from source4/scripting/python/ to python/. 2013-03-02 03:57:34 +01:00
py3compat.h python: Add compatability helpers to determine if type is really bytes 2018-03-23 07:28:25 +01:00
pyglue.c python: py_strcasecmp_m & py_strstr_m don't handle unicode properly 2018-10-23 05:50:26 +02:00
wscript python/wscript: update to handle waf 2.0.4 2018-09-05 06:37:23 +02:00