summaryrefslogtreecommitdiff
path: root/source4/smbd
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-11 03:12:21 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-11 03:12:21 +0200
commit0fd0fc75c46b39a611c7f9a56081105714d73e36 (patch)
treeb93ef5e67e49a3aa49c37e13df3d6222b2df7095 /source4/smbd
parent69d38a95c29498c0266cb98b911faa3e7240c787 (diff)
parent47f7ef8f39ba482a7d6578ab82c9e0670381c4f8 (diff)
downloadsamba-0fd0fc75c46b39a611c7f9a56081105714d73e36.tar.gz
samba-0fd0fc75c46b39a611c7f9a56081105714d73e36.tar.bz2
samba-0fd0fc75c46b39a611c7f9a56081105714d73e36.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into selftest
Conflicts: selftest/selftest.pl
Diffstat (limited to 'source4/smbd')
-rw-r--r--source4/smbd/config.mk10
-rw-r--r--source4/smbd/process_model.c4
-rw-r--r--source4/smbd/process_model.h4
-rw-r--r--source4/smbd/process_prefork.c2
-rw-r--r--source4/smbd/process_single.c2
-rw-r--r--source4/smbd/process_standard.c5
-rw-r--r--source4/smbd/process_thread.c2
-rw-r--r--source4/smbd/samba.8.xml (renamed from source4/smbd/smbd.8.xml)19
-rw-r--r--source4/smbd/server.c3
-rw-r--r--source4/smbd/service_stream.c4
-rw-r--r--source4/smbd/service_task.c2
11 files changed, 30 insertions, 27 deletions
diff --git a/source4/smbd/config.mk b/source4/smbd/config.mk
index e60f444456..b5babd4d69 100644
--- a/source4/smbd/config.mk
+++ b/source4/smbd/config.mk
@@ -17,9 +17,7 @@ PIDFILE_OBJ_FILES = $(smbdsrcdir)/pidfile.o
$(eval $(call proto_header_template,$(smbdsrcdir)/pidfile.h,$(PIDFILE_OBJ_FILES:.o=.c)))
-#################################
-# Start BINARY smbd
-[BINARY::smbd]
+[BINARY::samba]
INSTALLDIR = SBINDIR
PRIVATE_DEPENDENCIES = \
process_model \
@@ -36,8 +34,6 @@ PRIVATE_DEPENDENCIES = \
share \
CLUSTER
-smbd_OBJ_FILES = $(smbdsrcdir)/server.o
+samba_OBJ_FILES = $(smbdsrcdir)/server.o
-MANPAGES += $(smbdsrcdir)/smbd.8
-# End BINARY smbd
-#################################
+MANPAGES += $(smbdsrcdir)/samba.8
diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c
index 704e6cc7a2..d99d517d9f 100644
--- a/source4/smbd/process_model.c
+++ b/source4/smbd/process_model.c
@@ -22,6 +22,8 @@
#include "smbd/process_model.h"
#include "param/param.h"
+static const struct model_ops *process_model_byname(const char *name);
+
/*
setup the events for the chosen process model
*/
@@ -99,7 +101,7 @@ _PUBLIC_ NTSTATUS process_model_init(struct loadparm_context *lp_ctx)
/*
return the operations structure for a named backend of the specified type
*/
-_PUBLIC_ const struct model_ops *process_model_byname(const char *name)
+static const struct model_ops *process_model_byname(const char *name)
{
int i;
diff --git a/source4/smbd/process_model.h b/source4/smbd/process_model.h
index b545212091..6afb66ff20 100644
--- a/source4/smbd/process_model.h
+++ b/source4/smbd/process_model.h
@@ -63,7 +63,8 @@ struct model_ops {
void *);
/* function to terminate a connection or task */
- void (*terminate)(struct event_context *, const char *reason);
+ void (*terminate)(struct event_context *, struct loadparm_context *lp_ctx,
+ const char *reason);
/* function to set a title for the connection or task */
void (*set_title)(struct event_context *, const char *title);
@@ -78,7 +79,6 @@ struct process_model_critical_sizes {
extern const struct model_ops single_ops;
const struct model_ops *process_model_startup(struct event_context *ev, const char *model);
-const struct model_ops *process_model_byname(const char *name);
NTSTATUS register_process_model(const void *_ops);
NTSTATUS process_model_init(struct loadparm_context *lp_ctx);
diff --git a/source4/smbd/process_prefork.c b/source4/smbd/process_prefork.c
index 0d17e5301d..1b369613ff 100644
--- a/source4/smbd/process_prefork.c
+++ b/source4/smbd/process_prefork.c
@@ -189,7 +189,7 @@ static void prefork_new_task(struct event_context *ev,
/* called when a task goes down */
-_NORETURN_ static void prefork_terminate(struct event_context *ev, const char *reason)
+_NORETURN_ static void prefork_terminate(struct event_context *ev, struct loadparm_context *lp_ctx, const char *reason)
{
DEBUG(2,("prefork_terminate: reason[%s]\n",reason));
}
diff --git a/source4/smbd/process_single.c b/source4/smbd/process_single.c
index a7a27ef9e0..26afff9930 100644
--- a/source4/smbd/process_single.c
+++ b/source4/smbd/process_single.c
@@ -95,7 +95,7 @@ static void single_new_task(struct event_context *ev,
/* called when a task goes down */
-static void single_terminate(struct event_context *ev, const char *reason)
+static void single_terminate(struct event_context *ev, struct loadparm_context *lp_ctx, const char *reason)
{
DEBUG(2,("single_terminate: reason[%s]\n",reason));
}
diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c
index c8f90209b6..0a864dabb2 100644
--- a/source4/smbd/process_standard.c
+++ b/source4/smbd/process_standard.c
@@ -196,13 +196,14 @@ static void standard_new_task(struct event_context *ev,
/* called when a task goes down */
-_NORETURN_ static void standard_terminate(struct event_context *ev, const char *reason)
+_NORETURN_ static void standard_terminate(struct event_context *ev, struct loadparm_context *lp_ctx,
+ const char *reason)
{
DEBUG(2,("standard_terminate: reason[%s]\n",reason));
/* this reload_charcnv() has the effect of freeing the iconv context memory,
which makes leak checking easier */
- reload_charcnv(global_loadparm);
+ reload_charcnv(lp_ctx);
talloc_free(ev);
diff --git a/source4/smbd/process_thread.c b/source4/smbd/process_thread.c
index 540d956420..597cf587f1 100644
--- a/source4/smbd/process_thread.c
+++ b/source4/smbd/process_thread.c
@@ -188,7 +188,7 @@ static void thread_new_task(struct event_context *ev,
}
/* called when a task goes down */
-static void thread_terminate(struct event_context *event_ctx, const char *reason)
+static void thread_terminate(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const char *reason)
{
DEBUG(10,("thread_terminate: reason[%s]\n",reason));
diff --git a/source4/smbd/smbd.8.xml b/source4/smbd/samba.8.xml
index a02c2ce80a..e1ec8cabd5 100644
--- a/source4/smbd/smbd.8.xml
+++ b/source4/smbd/samba.8.xml
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
-<refentry id="smbd.8">
+<refentry id="samba.8">
<refmeta>
- <refentrytitle>smbd</refentrytitle>
+ <refentrytitle>samba</refentrytitle>
<manvolnum>8</manvolnum>
</refmeta>
<refnamediv>
- <refname>smbd</refname>
+ <refname>samba</refname>
<refpurpose>server to provide filesharing- and directory services to clients</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
- <command>smbd</command>
+ <command>samba</command>
<arg choice="opt">-i</arg>
<arg choice="opt">-M model</arg>
</cmdsynopsis>
@@ -26,7 +26,7 @@
<para>This program is part of the <citerefentry><refentrytitle>samba</refentrytitle>
<manvolnum>7</manvolnum></citerefentry> suite.</para>
- <para><command>smbd</command> is the server daemon that
+ <para><command>samba</command> is the server daemon that
provides filesharing and directory services to Windows clients.
The server provides filespace and directory services to
clients using the SMB (or CIFS) protocol and other
@@ -51,8 +51,9 @@
<manvolnum>5</manvolnum></citerefentry> manual page should be regarded as mandatory reading before
proceeding with installation.</para>
- <para>As of Samba 4, smbd also incorporates all the functionality of
- nmbd.</para>
+ <para>As of Samba 4, there is a single daemon that incorporates the
+ functionality of both smbd and nmbd that are present in older versions
+ of Samba.</para>
</refsect1>
@@ -66,7 +67,7 @@
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 deamon mode when run from the
- command line. <command>smbd</command> also logs to standard
+ command line. <command>samba</command> also logs to standard
output, as if the <command>-S</command> parameter had been
given.
</para></listitem>
@@ -75,7 +76,7 @@
<varlistentry>
<term>-M model</term>
<listitem><para>This parameter can be used to specify the
- &quot;process model&quot; smbd should use. This determines
+ &quot;process model&quot; samba should use. This determines
how concurrent clients are handled. Available process
models include <emphasis>single</emphasis> (everything in
a single process), <emphasis>standard</emphasis> (similar
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 5bd5568913..fd4b21b17f 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -199,7 +199,8 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
extern NTSTATUS server_service_drepl_init(void);
extern NTSTATUS server_service_rpc_init(void);
extern NTSTATUS server_service_ntp_signd_init(void);
- init_module_fn static_init[] = { STATIC_smbd_MODULES };
+ extern NTSTATUS server_service_samba3_smb_init(void);
+ init_module_fn static_init[] = { STATIC_samba_MODULES };
init_module_fn *shared_init;
struct event_context *event_ctx;
uint16_t stdin_event_flags;
diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c
index f27560f6ee..ce5b6519a1 100644
--- a/source4/smbd/service_stream.c
+++ b/source4/smbd/service_stream.c
@@ -61,6 +61,8 @@ void stream_terminate_connection(struct stream_connection *srv_conn, const char
if (!reason) reason = "unknown reason";
+ DEBUG(3,("Terminating connection - '%s'\n", reason));
+
srv_conn->terminate = reason;
if (srv_conn->processing) {
@@ -76,8 +78,8 @@ void stream_terminate_connection(struct stream_connection *srv_conn, const char
talloc_free(srv_conn->event.fde);
srv_conn->event.fde = NULL;
+ model_ops->terminate(event_ctx, srv_conn->lp_ctx, reason);
talloc_free(srv_conn);
- model_ops->terminate(event_ctx, reason);
}
/**
diff --git a/source4/smbd/service_task.c b/source4/smbd/service_task.c
index 2274685059..9a2903e281 100644
--- a/source4/smbd/service_task.c
+++ b/source4/smbd/service_task.c
@@ -35,7 +35,7 @@ void task_server_terminate(struct task_server *task, const char *reason)
struct event_context *event_ctx = task->event_ctx;
const struct model_ops *model_ops = task->model_ops;
DEBUG(0,("task_server_terminate: [%s]\n", reason));
- model_ops->terminate(event_ctx, reason);
+ model_ops->terminate(event_ctx, task->lp_ctx, reason);
/* don't free this above, it might contain the 'reason' being printed */
talloc_free(task);