s4-libads: Confirm newer functional levels in check_cldap_reply_required_flags()
authorAndrew Bartlett <abartlet@samba.org>
Tue, 30 May 2023 02:28:42 +0000 (14:28 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 31 May 2023 04:02:36 +0000 (04:02 +0000)
This will allow us to require that the target DC has FL 2008,
2012, 2012R2 or 2016.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
selftest/knownfail.d/getdcname
source3/libads/cldap.c

index c6d5b451971109236998eac1679bce4758d82843..55bb6c822240f7d8082e948bf97594dbc1b03246 100644 (file)
@@ -1,4 +1,4 @@
-^samba.tests.getdcname.samba.tests.getdcname.GetDCNameEx.test_get_dc_direct_need_2012r2_but_not_found
-^samba.tests.getdcname.samba.tests.getdcname.GetDCNameEx.test_get_dc_winbind_need_2012r2_but_not_found
+^samba.tests.getdcname.samba.tests.getdcname.GetDCNameEx.test_get_dc_direct_need_2012r2_but_not_found\(fl2008r2dc\)
+^samba.tests.getdcname.samba.tests.getdcname.GetDCNameEx.test_get_dc_direct_need_2012r2_but_not_found_fallback
 ^samba.tests.getdcname.samba.tests.getdcname.GetDCNameEx.test_get_dc_direct_need_web_but_not_found
-^samba.tests.getdcname.samba.tests.getdcname.GetDCNameEx.test_get_dc_winbind_need_web_but_not_found
\ No newline at end of file
+^samba.tests.getdcname.samba.tests.getdcname.GetDCNameEx.test_get_dc_winbind_need_web_but_not_found
index c44201ab8b58e968cc741a1724762f67ff41b193..623d98dcdf41661f2710076ec1c3d02d780afc0a 100644 (file)
@@ -82,6 +82,19 @@ bool check_cldap_reply_required_flags(uint32_t ret_flags,
        if (req_flags & DS_WRITABLE_REQUIRED)
                RETURN_ON_FALSE(ret_flags & NBT_SERVER_WRITABLE);
 
+       if (req_flags & DS_DIRECTORY_SERVICE_6_REQUIRED)
+               RETURN_ON_FALSE(ret_flags & (NBT_SERVER_SELECT_SECRET_DOMAIN_6
+                                            |NBT_SERVER_FULL_SECRET_DOMAIN_6));
+
+       if (req_flags & DS_DIRECTORY_SERVICE_8_REQUIRED)
+               RETURN_ON_FALSE(ret_flags & NBT_SERVER_DS_8);
+
+       if (req_flags & DS_DIRECTORY_SERVICE_9_REQUIRED)
+               RETURN_ON_FALSE(ret_flags & NBT_SERVER_DS_9);
+
+       if (req_flags & DS_DIRECTORY_SERVICE_10_REQUIRED)
+               RETURN_ON_FALSE(ret_flags & NBT_SERVER_DS_10);
+
        return true;
 }