python: Fix NtVer check for site_dn_for_machine()
authorAndreas Schneider <asn@samba.org>
Mon, 15 Apr 2024 05:32:02 +0000 (07:32 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 17 Apr 2024 19:32:11 +0000 (19:32 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15633

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Apr 17 19:32:11 UTC 2024 on atb-devel-224

python/samba/gp/gpclass.py

index 08be472e7073644420ec6c5f4b5463fafd15d058..d86aacec13877e0611a7e14720e1816f24f8c009 100644 (file)
@@ -805,9 +805,7 @@ def site_dn_for_machine(samdb, dc_hostname, lp, creds, hostname):
 
     samlogon_response = ndr_unpack(nbt.netlogon_samlogon_response,
                                    bytes(res.msgs[0]['Netlogon'][0]))
-    if samlogon_response.ntver not in [nbt.NETLOGON_NT_VERSION_5EX,
-                                       (nbt.NETLOGON_NT_VERSION_1
-                                        | nbt.NETLOGON_NT_VERSION_5EX)]:
+    if not (samlogon_response.ntver & nbt.NETLOGON_NT_VERSION_5EX):
         raise RuntimeError('site_dn_for_machine: Invalid NtVer in '
                            + 'netlogon_samlogon_response')