From: Stefan Metzmacher Date: Thu, 3 Apr 2025 13:39:40 +0000 (+0200) Subject: s3:smbd: setup parent->transports from 'smb ports' X-Git-Tag: tevent-0.17.0~296 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f3f8c4a6ba837e24e7a12193415c70140a1cb28;p=thirdparty%2Fsamba.git s3:smbd: setup parent->transports from 'smb ports' This will be used in the next commits and in the end derived from the 'server smb transports' option. Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 473002221dc..ab8248aee03 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -74,6 +74,8 @@ struct smbd_parent_context { struct tevent_context *ev_ctx; struct messaging_context *msg_ctx; + struct smb_transports transports; + /* the list of listening sockets */ struct smbd_open_socket *sockets; @@ -2108,6 +2110,26 @@ extern void build_options(bool screen); parent->msg_ctx = msg_ctx; am_parent = parent; + if (ports != NULL) { + const char **ts = NULL; + char **l = NULL; + l = str_list_make_v3(talloc_tos(), ports, NULL); + ts = discard_const_p(const char *, l); + parent->transports = smb_transports_parse("--ports", + ts); + if (parent->transports.num_transports == 0) { + exit_server("no valid transport from '--ports'"); + } + } else { + const char **ts = lp_smb_ports(); + parent->transports = smb_transports_parse("smb ports", + ts); + if (parent->transports.num_transports == 0) { + exit_server("no valid transport from " + "'smb ports'"); + } + } + se = tevent_add_signal(parent->ev_ctx, parent, SIGTERM, 0,