[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Thu Apr 29 04:49:01 UTC 2021
The branch, master has been updated
via 757c49f6dc5 s3:winbind: For 'security = ADS' require realm/workgroup to be set
via 32868286094 s3:utils: Tell users that workgroup/realm is required for ADS mode
via 0d243b329bd docs-xml: Update samba.8 manpage for new cmdline opition parser
via 236c35f702d s4:samba: Migrate samba daemon to new cmdline option parser
via 7d675bdae9f s4:samba: Pass a talloc memory context to binary_smbd_main()
via 0531f6f5331 docs-xml: Update winbindd manpage for new cmdline opition parser
via 93dfd5275d1 docs-xml: Update smbd manpage for new cmdline opition parser
via 4be015dd106 docs-xml: Update nmbd manpage for new cmdline opition parser
via 3467214cf96 s3: Remove --log-stdout from daemons
via c7b1d2d11cf lib:util: Add debug_get_log_type() function
via c23f75cd62d s3:winbind: Migrate winbindd to new cmdline option parser
via d8f84205337 s3:smbd: Migrate smbd to new cmdline option parser
via 87927173e85 s3:nmbd: Migrate nmbd to new cmdline option parser
from 7e63e84d47d WHATSNEW: Document removal of NIS support
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 757c49f6dc52afd6ee39c0b282e9a787b6df7a12
Author: Andreas Schneider <asn at samba.org>
Date: Wed Apr 28 12:25:42 2021 +0200
s3:winbind: For 'security = ADS' require realm/workgroup to be set
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14695
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Thu Apr 29 04:48:37 UTC 2021 on sn-devel-184
commit 328682860940679553831b6ff23acff4ce80a22f
Author: Andreas Schneider <asn at samba.org>
Date: Wed Apr 28 12:09:21 2021 +0200
s3:utils: Tell users that workgroup/realm is required for ADS mode
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14695
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 0d243b329bdcf9b884b1db1f415599b5e233e663
Author: Andreas Schneider <asn at samba.org>
Date: Thu Feb 11 14:31:26 2021 +0100
docs-xml: Update samba.8 manpage for new cmdline opition parser
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 236c35f702d21fde5db7834ffaeab3f3032a2136
Author: Andreas Schneider <asn at samba.org>
Date: Thu Jan 14 09:50:10 2021 +0100
s4:samba: Migrate samba daemon to new cmdline option parser
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 7d675bdae9f659c5402ae3853419b2ee0460d2be
Author: Andreas Schneider <asn at samba.org>
Date: Thu Jan 14 09:36:47 2021 +0100
s4:samba: Pass a talloc memory context to binary_smbd_main()
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 0531f6f5331508bb5fa24e3fc5e62aaafa94f383
Author: Andreas Schneider <asn at samba.org>
Date: Fri Jan 15 15:14:39 2021 +0100
docs-xml: Update winbindd manpage for new cmdline opition parser
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 93dfd5275d1c05419458a05b0480d9881c0ca1bd
Author: Andreas Schneider <asn at samba.org>
Date: Fri Jan 15 14:41:51 2021 +0100
docs-xml: Update smbd manpage for new cmdline opition parser
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 4be015dd106bc45b45dafd49dc20d5ffbf19b457
Author: Andreas Schneider <asn at samba.org>
Date: Fri Jan 15 15:10:46 2021 +0100
docs-xml: Update nmbd manpage for new cmdline opition parser
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 3467214cf967641f4e4001a9dfea870f933fc2a3
Author: Andreas Schneider <asn at samba.org>
Date: Mon Jan 11 09:52:36 2021 +0100
s3: Remove --log-stdout from daemons
The common cmdline parser provides --debug-stdout.
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit c7b1d2d11cfc348e654375fc1e880bf4e1773b88
Author: Andreas Schneider <asn at samba.org>
Date: Fri Jan 8 08:31:24 2021 +0100
lib:util: Add debug_get_log_type() function
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit c23f75cd62df38179b08ddf4061d434aeb31eb12
Author: Andreas Schneider <asn at samba.org>
Date: Mon Jan 11 10:20:41 2021 +0100
s3:winbind: Migrate winbindd to new cmdline option parser
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit d8f84205337a8baae7f4057a042e74b3d1c3633a
Author: Andreas Schneider <asn at samba.org>
Date: Tue Jan 5 14:35:39 2021 +0100
s3:smbd: Migrate smbd to new cmdline option parser
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 87927173e85712c458cf7d0582da14dd2959d2ac
Author: Andreas Schneider <asn at samba.org>
Date: Tue Jan 5 14:28:53 2021 +0100
s3:nmbd: Migrate nmbd to new cmdline option parser
This removes --log-stdout as we already have --debug-stdout in the
common options!
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
-----------------------------------------------------------------------
Summary of changes:
docs-xml/manpages/nmbd.8.xml | 34 ++++-----
docs-xml/manpages/samba.8.xml | 58 ++++++--------
docs-xml/manpages/smbd.8.xml | 56 +++++++-------
docs-xml/manpages/winbindd.8.xml | 53 ++++++-------
file_server/file_server.c | 2 +-
lib/util/debug.c | 5 ++
lib/util/debug.h | 1 +
selftest/target/Samba3.pm | 10 +--
source3/nmbd/nmbd.c | 52 ++++++-------
source3/nmbd/wscript_build | 2 +-
source3/smbd/server.c | 69 +++++++++--------
source3/utils/testparm.c | 22 ++++++
source3/winbindd/winbindd.c | 98 ++++++++++++------------
source3/winbindd/wscript_build | 2 +-
source3/wscript_build | 2 +-
source4/samba/server.c | 110 +++++++++++++++++++--------
source4/samba/wscript_build | 2 +-
source4/setup/tests/blackbox_start_backup.sh | 2 +-
source4/smb_server/service_smb.c | 6 +-
source4/smb_server/wscript_build | 2 +-
source4/winbind/winbindd.c | 2 +-
21 files changed, 320 insertions(+), 270 deletions(-)
Changeset truncated at 500 lines:
diff --git a/docs-xml/manpages/nmbd.8.xml b/docs-xml/manpages/nmbd.8.xml
index 4ece42f3ca6..5400a671357 100644
--- a/docs-xml/manpages/nmbd.8.xml
+++ b/docs-xml/manpages/nmbd.8.xml
@@ -21,16 +21,20 @@
<cmdsynopsis>
<command>nmbd</command>
<arg choice="opt">-D|--daemon</arg>
- <arg choice="opt">-F|--foreground</arg>
- <arg choice="opt">-S|--log-stdout</arg>
<arg choice="opt">-i|--interactive</arg>
- <arg choice="opt">-V</arg>
- <arg choice="opt">-d <debug level></arg>
- <arg choice="opt">-H|--hosts <lmhosts file></arg>
- <arg choice="opt">-l <log directory></arg>
- <arg choice="opt">-p|--port <port number></arg>
- <arg choice="opt">-s <configuration file></arg>
+ <arg choice="opt">-F|--foreground</arg>
<arg choice="opt">--no-process-group</arg>
+ <arg choice="opt">-b|--build-options</arg>
+ <arg choice="opt">-p <port number(s)></arg>
+ <arg choice="opt">-P <profiling level></arg>
+ <arg choice="opt">-d <debug level></arg>
+ <arg choice="opt">--debug-stdout</arg>
+ <arg choice="opt">--configfile=<configuration file></arg>
+ <arg choice="opt">--option=<name>=<value></arg>
+ <arg choice="opt">-l|--log-basename <log directory></arg>
+ <arg choice="opt">--leak-report</arg>
+ <arg choice="opt">--leak-report-full</arg>
+ <arg choice="opt">-V|--version</arg>
</cmdsynopsis>
</refsynopsisdiv>
@@ -105,13 +109,6 @@
</para></listitem>
</varlistentry>
- <varlistentry>
- <term>-S|--log-stdout</term>
- <listitem><para>If specified, this parameter causes
- <command>nmbd</command> to log to standard output rather
- than a file.</para></listitem>
- </varlistentry>
-
<varlistentry>
<term>-i|--interactive</term>
<listitem><para>If this parameter is specified it causes the
@@ -123,8 +120,6 @@
given. </para></listitem>
</varlistentry>
- &popt.autohelp;
-
<varlistentry>
<term>-H|--hosts <filename></term>
<listitem><para>NetBIOS lmhosts file. The lmhosts
@@ -146,9 +141,6 @@
<manvolnum>5</manvolnum></citerefentry> man page for details on the contents of this file.</para></listitem>
</varlistentry>
- &stdarg.server.debug;
- &popt.common.samba;
-
<varlistentry>
<term>-p|--port <UDP port number></term>
<listitem><para>UDP port number is a positive integer value.
@@ -164,6 +156,8 @@
</para></listitem>
</varlistentry>
+ &cmdline.common.samba.server;
+ &popt.autohelp;
</variablelist>
</refsect1>
diff --git a/docs-xml/manpages/samba.8.xml b/docs-xml/manpages/samba.8.xml
index 35b3e9f464e..c2fd49d0019 100644
--- a/docs-xml/manpages/samba.8.xml
+++ b/docs-xml/manpages/samba.8.xml
@@ -19,21 +19,21 @@
<refsynopsisdiv>
<cmdsynopsis>
<command>samba</command>
- <arg choice="opt">-D</arg>
- <arg choice="opt">-i</arg>
- <arg choice="opt">-M <model></arg>
- <arg choice="opt">--maximum-runtime=<seconds></arg>
- <arg choice="opt">-b</arg>
- <arg choice="opt">--help</arg>
- <arg choice="opt">--usage</arg>
- <arg choice="opt">-d <debug level></arg>
- <arg choice="opt">--debug-stderr</arg>
- <arg choice="opt">-s <configuration file></arg>
- <arg choice="opt">--option=<smb_conf_param>=<value></arg>
- <arg choice="opt">-l <log directory></arg>
+ <arg choice="opt">-D|--daemon</arg>
+ <arg choice="opt">-F|--foreground</arg>
+ <arg choice="opt">-i|--interactive</arg>
+ <arg choice="opt">-M|--model=MODEL</arg>
+ <arg choice="opt">--maximum-runtime=seconds</arg>
+ <arg choice="opt">-b|--show-build</arg>
+ <arg choice="opt">--no-process-group</arg>
+ <arg choice="opt">-d|--debuglevel=DEBUGLEVEL</arg>
+ <arg choice="opt">--debug-stdout</arg>
+ <arg choice="opt">--configfile=CONFIGFILE</arg>
+ <arg choice="opt">--option=name=value</arg>
+ <arg choice="opt">-l|--log-basename=LOGFILEBASE</arg>
<arg choice="opt">--leak-report</arg>
<arg choice="opt">--leak-report-full</arg>
- <arg choice="opt">-V</arg>
+ <arg choice="opt">-V|--version</arg>
</cmdsynopsis>
</refsynopsisdiv>
@@ -88,6 +88,14 @@
</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term>-F|--foreground</term>
+ <listitem><para>If specified, this parameter causes
+ the <command>samba</command> process to not daemonize,
+ i.e. double-fork and disassociate with the terminal.
+ </para></listitem>
+ </varlistentry>
+
<varlistentry>
<term>-i|--interactive</term>
<listitem><para>If this parameter is specified it causes the
@@ -155,29 +163,7 @@
</para></listitem>
</varlistentry>
- <varlistentry>
- <term>--usage</term>
- <listitem><para>Display brief usage message.</para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term>--debug-stderr</term>
- <listitem><para>Send debug output to STDERR.</para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term>--leak-report</term>
- <listitem><para>Enable talloc leak reporting on exit.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term>--leak-report-full</term>
- <listitem><para>Enable full talloc leak reporting on exit.
- </para></listitem>
- </varlistentry>
-
- &popt.common.samba.server;
+ &cmdline.common.samba.server;
&popt.autohelp;
</variablelist>
</refsect1>
diff --git a/docs-xml/manpages/smbd.8.xml b/docs-xml/manpages/smbd.8.xml
index 73d808c70b7..ac4164fe1f8 100644
--- a/docs-xml/manpages/smbd.8.xml
+++ b/docs-xml/manpages/smbd.8.xml
@@ -20,17 +20,20 @@
<cmdsynopsis>
<command>smbd</command>
<arg choice="opt">-D|--daemon</arg>
- <arg choice="opt">-F|--foreground</arg>
- <arg choice="opt">-S|--log-stdout</arg>
<arg choice="opt">-i|--interactive</arg>
- <arg choice="opt">-V</arg>
+ <arg choice="opt">-F|--foreground</arg>
+ <arg choice="opt">--no-process-group</arg>
<arg choice="opt">-b|--build-options</arg>
- <arg choice="opt">-d <debug level></arg>
- <arg choice="opt">-l|--log-basename <log directory></arg>
<arg choice="opt">-p <port number(s)></arg>
<arg choice="opt">-P <profiling level></arg>
- <arg choice="opt">-s <configuration file></arg>
- <arg choice="opt">--no-process-group</arg>
+ <arg choice="opt">-d <debug level></arg>
+ <arg choice="opt">--debug-stdout</arg>
+ <arg choice="opt">--configfile=<configuration file></arg>
+ <arg choice="opt">--option=<name>=<value></arg>
+ <arg choice="opt">-l|--log-basename <log directory></arg>
+ <arg choice="opt">--leak-report</arg>
+ <arg choice="opt">--leak-report-full</arg>
+ <arg choice="opt">-V|--version</arg>
</cmdsynopsis>
</refsynopsisdiv>
@@ -99,6 +102,18 @@
</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term>-i|--interactive</term>
+ <listitem><para>If this parameter is specified it causes the
+ server to run "interactively", not as a daemon, even if the
+ server is executed on the command line of a shell. Setting this
+ parameter negates the implicit daemon mode when run from the
+ command line. <command>smbd</command> will only accept one
+ connection and terminate. It will also log to standard output,
+ as if the <command>-S</command> parameter had been given.
+ </para></listitem>
+ </varlistentry>
+
<varlistentry>
<term>-F|--foreground</term>
<listitem><para>If specified, this parameter causes
@@ -114,29 +129,6 @@
</para></listitem>
</varlistentry>
- <varlistentry>
- <term>-S|--log-stdout</term>
- <listitem><para>If specified, this parameter causes
- <command>smbd</command> to log to standard output rather
- than a file.</para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term>-i|--interactive</term>
- <listitem><para>If this parameter is specified it causes the
- server to run "interactively", not as a daemon, even if the
- server is executed on the command line of a shell. Setting this
- parameter negates the implicit daemon mode when run from the
- command line. <command>smbd</command> will only accept one
- connection and terminate. It will also log to standard output,
- as if the <command>-S</command> parameter had been given.
- </para></listitem>
- </varlistentry>
-
- &stdarg.server.debug;
- &popt.common.samba;
- &popt.autohelp;
-
<varlistentry>
<term>--no-process-group</term>
<listitem><para>Do not create a new process group for smbd.
@@ -168,6 +160,10 @@
2 turns on complete profiling, and 3 resets all profiling data.
</para></listitem>
</varlistentry>
+
+ &cmdline.common.samba.server;
+ &popt.autohelp;
+
</variablelist>
</refsect1>
diff --git a/docs-xml/manpages/winbindd.8.xml b/docs-xml/manpages/winbindd.8.xml
index d5acc072a00..3b7487c1b1c 100644
--- a/docs-xml/manpages/winbindd.8.xml
+++ b/docs-xml/manpages/winbindd.8.xml
@@ -21,13 +21,18 @@
<cmdsynopsis>
<command>winbindd</command>
<arg choice="opt">-D|--daemon</arg>
- <arg choice="opt">-F|--foreground</arg>
- <arg choice="opt">-S|--stdout</arg>
<arg choice="opt">-i|--interactive</arg>
- <arg choice="opt">-d <debug level></arg>
- <arg choice="opt">-s <smb config file></arg>
- <arg choice="opt">-n|--no-caching</arg>
+ <arg choice="opt">-F|--foreground</arg>
<arg choice="opt">--no-process-group</arg>
+ <arg choice="opt">-n|--no-caching</arg>
+ <arg choice="opt">-d <debug level></arg>
+ <arg choice="opt">--debug-stdout</arg>
+ <arg choice="opt">--configfile=<configuration file></arg>
+ <arg choice="opt">--option=<name>=<value></arg>
+ <arg choice="opt">-l|--log-basename <log directory></arg>
+ <arg choice="opt">--leak-report</arg>
+ <arg choice="opt">--leak-report-full</arg>
+ <arg choice="opt">-V|--version</arg>
</cmdsynopsis>
</refsynopsisdiv>
@@ -145,6 +150,17 @@ hosts: files wins
</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term>-i|--interactive</term>
+ <listitem><para>Tells <command>winbindd</command> to not
+ become a daemon and detach from the current terminal. This
+ option is used by developers when interactive debugging
+ of <command>winbindd</command> is required.
+ <command>winbindd</command> also logs to standard output,
+ as if the <command>-S</command> parameter had been given.
+ </para></listitem>
+ </varlistentry>
+
<varlistentry>
<term>-F|--foreground</term>
<listitem><para>If specified, this parameter causes
@@ -161,24 +177,8 @@ hosts: files wins
</varlistentry>
<varlistentry>
- <term>-S|--stdout</term>
- <listitem><para>If specified, this parameter causes
- <command>winbindd</command> to log to standard output rather
- than a file.</para></listitem>
- </varlistentry>
-
- &stdarg.server.debug;
- &popt.common.samba;
- &popt.autohelp;
-
- <varlistentry>
- <term>-i|--interactive</term>
- <listitem><para>Tells <command>winbindd</command> to not
- become a daemon and detach from the current terminal. This
- option is used by developers when interactive debugging
- of <command>winbindd</command> is required.
- <command>winbindd</command> also logs to standard output,
- as if the <command>-S</command> parameter had been given.
+ <term>--no-process-group</term>
+ <listitem><para>Do not create a new process group for winbindd.
</para></listitem>
</varlistentry>
@@ -195,11 +195,8 @@ hosts: files wins
</para></listitem>
</varlistentry>
- <varlistentry>
- <term>--no-process-group</term>
- <listitem><para>Do not create a new process group for winbindd.
- </para></listitem>
- </varlistentry>
+ &cmdline.common.samba.server;
+ &popt.autohelp;
</variablelist>
</refsect1>
diff --git a/file_server/file_server.c b/file_server/file_server.c
index b55f13f5687..b8e53cd675c 100644
--- a/file_server/file_server.c
+++ b/file_server/file_server.c
@@ -86,7 +86,7 @@ static NTSTATUS s3fs_task_init(struct task_server *task)
"--option=server role check:inhibit=yes",
"--foreground",
config_file,
- debug_get_output_is_stdout()?"--log-stdout":NULL,
+ debug_get_output_is_stdout()?"--debug-stdout":NULL,
NULL);
/* the parent should not be able to call through nss_winbind */
if (!winbind_off()) {
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 18e5b4f6c72..05a76efc5a4 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -1038,6 +1038,11 @@ static void debug_close_fd(int fd)
}
}
+enum debug_logtype debug_get_log_type(void)
+{
+ return state.logtype;
+}
+
bool debug_get_output_is_stderr(void)
{
return (state.logtype == DEBUG_DEFAULT_STDERR) || (state.logtype == DEBUG_STDERR);
diff --git a/lib/util/debug.h b/lib/util/debug.h
index 67dbf3357e3..9ab699a4148 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -320,6 +320,7 @@ void force_check_log_size( void );
bool need_to_check_log_size( void );
void check_log_size( void );
void dbgflush( void );
+enum debug_logtype debug_get_log_type(void);
bool debug_get_output_is_stderr(void);
bool debug_get_output_is_stdout(void);
void debug_schedule_reopen_logs(void);
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 40efa36fdf3..410b0458a4d 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -1847,7 +1847,7 @@ sub make_bin_cmd
"-l", $env_vars->{LOGDIR});
if (not defined($dont_log_stdout)) {
- push(@args, "--log-stdout");
+ push(@args, "--debug-stdout");
}
return (@preargs, $binary, @args, @optargs);
}
@@ -1895,11 +1895,9 @@ sub check_or_start($$) {
$binary = Samba::bindir_path($self, "winbindd");
@full_cmd = $self->make_bin_cmd($binary, $env_vars,
- $ENV{WINBINDD_OPTIONS}, $ENV{WINBINDD_VALGRIND}, "N/A");
-
- if (not defined($ENV{WINBINDD_DONT_LOG_STDOUT})) {
- push(@full_cmd, "--stdout");
- }
+ $ENV{WINBINDD_OPTIONS},
+ $ENV{WINBINDD_VALGRIND},
+ $ENV{WINBINDD_DONT_LOG_STDOUT});
# fork and exec() winbindd in the child process
$daemon_ctx = {
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index dce746a8339..05645967e05 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -21,7 +21,7 @@
#include "includes.h"
#include "system/filesys.h"
-#include "popt_common.h"
+#include "lib/cmdline/cmdline.h"
#include "nmbd/nmbd.h"
#include "serverid.h"
#include "messages.h"
@@ -784,8 +784,7 @@ static bool open_sockets(bool isdaemon, int port)
OPT_DAEMON = 1000,
OPT_INTERACTIVE,
OPT_FORK,
- OPT_NO_PROCESS_GROUP,
- OPT_LOG_STDOUT
+ OPT_NO_PROCESS_GROUP
};
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -822,14 +821,6 @@ static bool open_sockets(bool isdaemon, int port)
.val = OPT_NO_PROCESS_GROUP,
.descrip = "Don't create a new process group",
},
- {
- .longName = "log-stdout",
- .shortName = 'S',
- .argInfo = POPT_ARG_NONE,
- .arg = NULL,
- .val = OPT_LOG_STDOUT,
- .descrip = "Log to stdout",
- },
{
.longName = "hosts",
.shortName = 'H',
@@ -847,6 +838,7 @@ static bool open_sockets(bool isdaemon, int port)
.descrip = "Listen on the specified port",
},
POPT_COMMON_SAMBA
+ POPT_COMMON_VERSION
POPT_TABLEEND
};
const struct loadparm_substitution *lp_sub =
@@ -867,13 +859,30 @@ static bool open_sockets(bool isdaemon, int port)
*/
umask(0);
- setup_logging(argv[0], DEBUG_DEFAULT_STDOUT);
-
smb_init_locale();
+ ok = samba_cmdline_init(frame,
+ SAMBA_CMDLINE_CONFIG_SERVER,
+ true /* require_smbconf */);
+ if (!ok) {
+ DBG_ERR("Failed to init cmdline parser!\n");
+ TALLOC_FREE(frame);
+ exit(ENOMEM);
+ }
+
global_nmb_port = NMB_PORT;
- pc = poptGetContext("nmbd", argc, argv, long_options, 0);
+ pc = samba_popt_get_context(getprogname(),
+ argc,
+ argv,
+ long_options,
+ 0);
+ if (pc == NULL) {
+ DBG_ERR("Failed to setup popt context!\n");
+ TALLOC_FREE(frame);
+ exit(1);
+ }
+
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case OPT_DAEMON:
@@ -888,9 +897,6 @@ static bool open_sockets(bool isdaemon, int port)
case OPT_NO_PROCESS_GROUP:
no_process_group = true;
break;
- case OPT_LOG_STDOUT:
- log_stdout = true;
- break;
default:
d_fprintf(stderr, "\nInvalid option %s: %s\n\n",
poptBadOption(pc, 0), poptStrerror(opt));
@@ -915,7 +921,6 @@ static bool open_sockets(bool isdaemon, int port)
SAFE_FREE(lfile);
--
Samba Shared Repository
More information about the samba-cvs
mailing list