From: Jennifer Sutton Date: Mon, 13 Jan 2025 23:08:26 +0000 (+1300) Subject: drs_utils: Check for presence of more_flags attribute directly X-Git-Tag: tevent-0.17.0~128 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf848e35d1ddfbcc45325992459da059f968fe3a;p=thirdparty%2Fsamba.git drs_utils: Check for presence of more_flags attribute directly This more directly indicates what we are trying to achieve. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15852 Signed-off-by: Jennifer Sutton Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/drs_utils.py b/python/samba/drs_utils.py index 4b7fdacd846..beef4f8ada6 100644 --- a/python/samba/drs_utils.py +++ b/python/samba/drs_utils.py @@ -201,15 +201,15 @@ class drs_Replicate(object): self.replication_state = self.net.replicate_init(self.samdb, lp, self.drs, invocation_id) self.more_flags = 0 - def _should_retry_with_get_tgt(self, error_code, req): + @staticmethod + def _should_retry_with_get_tgt(error_code, req): # If the error indicates we fail to resolve a target object for a # linked attribute, then we should retry the request with GET_TGT # (if we support it and haven't already tried that) - supports_ext = self.supports_ext return (error_code == werror.WERR_DS_DRA_RECYCLED_TARGET and - supports_ext & DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V10 and + hasattr(req, "more_flags") and (req.more_flags & drsuapi.DRSUAPI_DRS_GET_TGT) == 0) @staticmethod