From bf8a22b2e459b990403e5593db404ed36deba78f Mon Sep 17 00:00:00 2001 From: Jo Sutton Date: Tue, 30 Jul 2024 16:55:17 +1200 Subject: [PATCH] lib:cmdline: Load network interfaces in _samba_cmdline_load_config_s4() 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 Reviewed-by: Douglas Bagnall --- lib/cmdline/cmdline_s4.c | 11 +++++++++++ lib/cmdline/wscript | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/cmdline/cmdline_s4.c b/lib/cmdline/cmdline_s4.c index f8be4ed670c..d26e1de93c1 100644 --- a/lib/cmdline/cmdline_s4.c +++ b/lib/cmdline/cmdline_s4.c @@ -20,9 +20,11 @@ #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; } diff --git a/lib/cmdline/wscript b/lib/cmdline/wscript index 01ead85e2c4..7ea6467b502 100644 --- a/lib/cmdline/wscript +++ b/lib/cmdline/wscript @@ -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',