s3:libads: always require ber_sockbuf_add_io() and LDAP_OPT_SOCKBUF
authorStefan Metzmacher <metze@samba.org>
Fri, 5 Apr 2024 15:23:54 +0000 (17:23 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 23 Apr 2024 23:50:34 +0000 (23:50 +0000)
There's no point in trying to support --with-ads, but only use
plaintext ldap without sign/seal.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/target/Samba3.pm
source3/include/includes.h
source3/libads/sasl_wrapping.c
source3/librpc/idl/ads.idl
source3/wscript
source4/scripting/bin/wscript_build
source4/scripting/wscript_build
wscript

index cf40633d127fc96609db228d8e612bbe64d6243f..0ae1eceb7d46d25e7838e73b681f625e917d83b8 100755 (executable)
@@ -31,7 +31,7 @@ sub have_ads($) {
         open(IN, $smbd_build_options) or die("Unable to run $smbd_build_options: $!");
 
         while (<IN>) {
-                if (/WITH_ADS/) {
+                if (/HAVE_ADS/) {
                        $found_ads = 1;
                 }
         }
index ee05b93c07d95c2357ecd01b61f4371ec322977c..b33f86a9565584c52335eb2ab4ae90f1906a0c87 100644 (file)
 #include <valgrind.h>
 #endif
 
-/* we support ADS if we want it and have krb5 and ldap libs */
-#if defined(WITH_ADS) && defined(HAVE_KRB5) && defined(HAVE_LDAP)
-#define HAVE_ADS
-#endif
-
 /*
  * Define additional missing types
  */
index 7f0794789486582e81e2e435f4ba74f024ecc528..b976cbfff21dacd6c3fcf41fea1a1c3f63728ccb 100644 (file)
@@ -25,9 +25,9 @@ void ndr_print_ads_saslwrap_struct(struct ndr_print *ndr, const char *name, cons
        ndr_print_struct(ndr, name, "saslwrap");
        ndr->depth++;
        ndr_print_uint16(ndr, "wrap_type", r->wrap_type);
-#ifdef HAVE_LDAP_SASL_WRAPPING
+#ifdef HAVE_ADS
        ndr_print_ptr(ndr, "sbiod", r->sbiod);
-#endif /* HAVE_LDAP_SASL_WRAPPING */
+#endif /* HAVE_ADS */
        ndr_print_ptr(ndr, "mem_ctx", r->mem_ctx);
        ndr_print_ptr(ndr, "wrap_ops", r->wrap_ops);
        ndr_print_ptr(ndr, "wrap_private_data", r->wrap_private_data);
@@ -52,7 +52,7 @@ void ndr_print_ads_saslwrap_struct(struct ndr_print *ndr, const char *name, cons
        ndr->depth--;
 }
 
-#ifdef HAVE_LDAP_SASL_WRAPPING
+#ifdef HAVE_ADS
 
 static int ads_saslwrap_setup(Sockbuf_IO_Desc *sbiod, void *arg)
 {
@@ -348,4 +348,4 @@ ADS_STATUS ads_setup_sasl_wrapping(struct ads_saslwrap *wrap, LDAP *ld,
 {
        return ADS_ERROR_NT(NT_STATUS_NOT_SUPPORTED);
 }
-#endif /* HAVE_LDAP_SASL_WRAPPING */
+#endif /* HAVE_ADS */
index b7658ca19eaa621008317a24a98d476c45d4f53c..4a63ace7c23280323bca8eb19b358bf076e70ea1 100644 (file)
@@ -92,9 +92,9 @@ interface ads
        typedef [nopull,nopush] struct {
                ads_saslwrap_type wrap_type;
                [ignore] ads_saslwrap_ops *wrap_ops;
-#ifdef HAVE_LDAP_SASL_WRAPPING
+#ifdef HAVE_ADS
                [ignore] struct sockbuf_io_desc *sbiod; /* lowlevel state for LDAP wrapping */
-#endif /* HAVE_LDAP_SASL_WRAPPING */
+#endif /* HAVE_ADS */
                [ignore] TALLOC_CTX *mem_ctx;
                [ignore] void *wrap_private_data;
                ads_ldap_buf_in in;
@@ -118,11 +118,11 @@ interface ads
                /* info derived from the servers config */
                ads_config config;
 
-#ifdef HAVE_LDAP
+#ifdef HAVE_ADS
                ads_saslwrap ldap_wrap_data;
                /* info about the current LDAP connection */
                ads_ldap ldap;
-#endif /* HAVE_LDAP */
+#endif /* HAVE_ADS */
 
        } ads_struct;
 }
index b98ad733f3875e6d59d70754d243932e75822ee1..4048ec5aad50c4be3958e53b7c6f4418e8af4301 100644 (file)
@@ -723,13 +723,13 @@ msg.msg_accrightslen = sizeof(fd);
             conf.undefine('HAVE_GSSAPI_GSSAPI_H')
             use_ads = False
 
-        if not conf.CONFIG_SET('HAVE_LDAP'):
+        if not conf.CONFIG_SET('HAVE_LDAP_TRANSPORT_WRAPPING'):
+            Logs.warn("need ber_sockbuf_add_io() and LDAP_OPT_SOCKBUF for SASL and TLS support")
             use_ads = False
             use_ads_ldap = False
 
     if use_ads:
-        conf.DEFINE('WITH_ADS', '1')
-        conf.env['HAVE_ADS'] = '1'
+        conf.DEFINE('HAVE_ADS', '1')
         Logs.info("Building with Active Directory support.")
         # these have broken dependencies
         forced_shared_modules.extend(['idmap_ad', 'idmap_rfc2307'])
index d31afb2f13266e46cf218af8177511b451041347..5de0d6ff3c8a8ed39bccf6c34c2ffbc3159dbad7 100644 (file)
@@ -9,6 +9,6 @@ if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
                    'gen_output.py',
                    'samba_downgrade_db']:
         bld.SAMBA_SCRIPT(script, pattern=script, installdir='.')
-if bld.CONFIG_SET('WITH_ADS'):
+if bld.CONFIG_SET('HAVE_ADS'):
     bld.SAMBA_SCRIPT('samba-tool', pattern='samba-tool', installdir='.')
 bld.SAMBA_SCRIPT('samba-gpupdate', pattern='samba-gpupdate', installdir='.')
index 6728dec998e365e6286f855cb512e971109302f2..72e4653c5f786876de309ce1a4578323253a93bb 100644 (file)
@@ -16,7 +16,7 @@ if sbin_files:
     if 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']:
         bld.MANPAGES(man_files, True)
 
-if bld.CONFIG_SET('WITH_ADS'):
+if bld.CONFIG_SET('HAVE_ADS'):
     bld.INSTALL_FILES('${BINDIR}',
                   'bin/samba-tool',
                   chmod=MODE_755, python_fixup=True, flat=True)
diff --git a/wscript b/wscript
index 57545c6a57195e15235d087b222a9cbf8f72c6b4..c833764e8fe97dcea50438603b774817379eba3e 100644 (file)
--- a/wscript
+++ b/wscript
@@ -291,7 +291,7 @@ def configure(conf):
             # SASL wrapping hooks
             if conf.CONFIG_SET('HAVE_BER_SOCKBUF_ADD_IO') and \
                     conf.CONFIG_SET('HAVE_LDAP_OPT_SOCKBUF'):
-                conf.DEFINE('HAVE_LDAP_SASL_WRAPPING', '1')
+                conf.DEFINE('HAVE_LDAP_TRANSPORT_WRAPPING', 1)
             conf.env.ENABLE_LDAP_BACKEND = True
         else:
             conf.fatal("LDAP support not found. "