]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:cmdline: Load network interfaces in _samba_cmdline_load_config_s4()
authorJo Sutton <josutton@catalyst.net.nz>
Tue, 30 Jul 2024 04:55:17 +0000 (16:55 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Sun, 4 Aug 2024 00:32:39 +0000 (00:32 +0000)
This makes the samba.tests.domain_backup tests start working again when
they are run standalone. Without the load_interfaces() call,
smb_sysvol_conn() fails to make a connection to the sysvol share.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/cmdline/cmdline_s4.c
lib/cmdline/wscript

index f8be4ed670cf795fb21144a4d10474fddb9f3fd8..d26e1de93c1765fcc47beccb49a1c71686ae4f03 100644 (file)
 #include "lib/param/param.h"
 #include "lib/util/debug.h"
 #include "lib/util/fault.h"
+#include "lib/util/talloc_stack.h"
 #include "auth/credentials/credentials.h"
 #include "dynconfig/dynconfig.h"
 #include "cmdline_private.h"
+#include "source3/lib/interface.h"
 
 static bool _require_smbconf;
 static enum samba_cmdline_config_type _config_type;
@@ -82,6 +84,15 @@ static bool _samba_cmdline_load_config_s4(void)
                break;
        }
 
+       {
+               /* load_interfaces() requires a talloc stackframe. */
+               TALLOC_CTX *frame = talloc_stackframe();
+
+               load_interfaces();
+
+               TALLOC_FREE(frame);
+       }
+
        return true;
 }
 
index 01ead85e2c48c2f51c169e6bf98fea446a370bf1..7ea6467b50269f372162e6383be56804cef1fe2c 100644 (file)
@@ -26,7 +26,7 @@ def build(bld):
 
     bld.SAMBA_SUBSYSTEM('CMDLINE_S4',
                         source='cmdline_s4.c',
-                        deps='cmdline')
+                        deps='cmdline samba3core')
 
     bld.SAMBA_BINARY('test_cmdline',
                      source='tests/test_cmdline.c',