[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Mon Apr 28 21:29:04 MDT 2014
The branch, master has been updated
via 77b04f1 winbind: Allow winbindd to be run from inside "samba"
from 086c06e kerberos: Remove un-used event context argument from smb_krb5_init_context()
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 77b04f1df6bb916fcf07d92e22b837e131d09034
Author: Andrew Bartlett <abartlet at samba.org>
Date: Fri Mar 28 14:35:21 2014 +1300
winbind: Allow winbindd to be run from inside "samba"
Change-Id: I6b90a9b62ba5821e0feedb23cd20642078ba0ca6
Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim at samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Tue Apr 29 05:28:39 CEST 2014 on sn-devel-104
-----------------------------------------------------------------------
Summary of changes:
source3/winbindd/winbindd.c | 3 +-
.../file_server.c => source4/winbind/winbindd.c | 55 +++++++++-----------
source4/winbind/wscript_build | 8 +++
3 files changed, 34 insertions(+), 32 deletions(-)
copy file_server/file_server.c => source4/winbind/winbindd.c (50%)
Changeset truncated at 500 lines:
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 937f68d..a1647c9 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -1460,7 +1460,8 @@ int main(int argc, const char **argv)
*/
dump_core_setup("winbindd", lp_logfile(talloc_tos()));
- if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC) {
+ if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC
+ && !lp_parm_bool(-1, "server role check", "inhibit", false)) {
DEBUG(0, ("server role = 'active directory domain controller' not compatible with running the winbindd binary. \n"));
DEBUGADD(0, ("You should start 'samba' instead, and it will control starting the internal AD DC winbindd implementation, which is not the same as this one\n"));
exit(1);
diff --git a/file_server/file_server.c b/source4/winbind/winbindd.c
similarity index 50%
copy from file_server/file_server.c
copy to source4/winbind/winbindd.c
index aab5f39..f702739 100644
--- a/file_server/file_server.c
+++ b/source4/winbind/winbindd.c
@@ -1,9 +1,10 @@
/*
Unix SMB/CIFS implementation.
- run s3 file server within Samba4
+ run s3 winbindd server within Samba4
Copyright (C) Andrew Tridgell 2011
+ Copyright (C) Andrew Bartlett 2014
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,9 +32,9 @@
#include "nsswitch/winbind_client.h"
/*
- called if smbd exits
+ called if winbindd exits
*/
-static void file_server_smbd_done(struct tevent_req *subreq)
+static void winbindd_done(struct tevent_req *subreq)
{
struct task_server *task =
tevent_req_callback_data(subreq,
@@ -43,59 +44,51 @@ static void file_server_smbd_done(struct tevent_req *subreq)
ret = samba_runcmd_recv(subreq, &sys_errno);
if (ret != 0) {
- DEBUG(0,("file_server smbd daemon died with exit status %d\n", sys_errno));
+ DEBUG(0,("winbindd daemon died with exit status %d\n", sys_errno));
} else {
- DEBUG(0,("file_server smbd daemon exited normally\n"));
+ DEBUG(0,("winbindd daemon exited normally\n"));
}
- task_server_terminate(task, "smbd child process exited", true);
+ task_server_terminate(task, "winbindd child process exited", true);
}
/*
- startup a copy of smbd as a child daemon
+ startup a copy of winbindd as a child daemon
*/
-static void s3fs_task_init(struct task_server *task)
+static void winbindd_task_init(struct task_server *task)
{
struct tevent_req *subreq;
- const char *smbd_path;
- const char *smbd_cmd[2] = { NULL, NULL };
+ const char *winbindd_path;
+ const char *winbindd_cmd[2] = { NULL, NULL };
- task_server_set_title(task, "task[s3fs_parent]");
+ task_server_set_title(task, "task[winbindd_parent]");
- smbd_path = talloc_asprintf(task, "%s/smbd", dyn_SBINDIR);
- smbd_cmd[0] = smbd_path;
+ winbindd_path = talloc_asprintf(task, "%s/winbindd", dyn_SBINDIR);
+ winbindd_cmd[0] = winbindd_path;
- /* the child should be able to call through nss_winbind */
- (void)winbind_on();
/* start it as a child process */
subreq = samba_runcmd_send(task, task->event_ctx, timeval_zero(), 1, 0,
- smbd_cmd,
+ winbindd_cmd,
"-D",
"--option=server role check:inhibit=yes",
"--foreground",
- debug_get_output_is_stdout()?"--log-stdout":NULL,
+ debug_get_output_is_stdout()?"--stdout":NULL,
NULL);
- /* the parent should not be able to call through nss_winbind */
- if (!winbind_off()) {
- DEBUG(0,("Failed to re-disable recursive winbindd calls after forking smbd\n"));
- task_server_terminate(task, "Failed to re-disable recursive winbindd calls", true);
- return;
- }
if (subreq == NULL) {
- DEBUG(0, ("Failed to start smbd as child daemon\n"));
- task_server_terminate(task, "Failed to startup s3fs smb task", true);
+ DEBUG(0, ("Failed to start winbindd as child daemon\n"));
+ task_server_terminate(task, "Failed to startup winbindd task", true);
return;
}
- tevent_req_set_callback(subreq, file_server_smbd_done, task);
+ tevent_req_set_callback(subreq, winbindd_done, task);
- DEBUG(5,("Started file server child smbd\n"));
+ DEBUG(5,("Started file server child winbindd\n"));
}
-/* called at smbd startup - register ourselves as a server service */
-NTSTATUS server_service_s3fs_init(void);
+/* called at winbindd startup - register ourselves as a server service */
+NTSTATUS server_service_winbindd_init(void);
-NTSTATUS server_service_s3fs_init(void)
+NTSTATUS server_service_winbindd_init(void)
{
- return register_server_service("s3fs", s3fs_task_init);
+ return register_server_service("winbindd", winbindd_task_init);
}
diff --git a/source4/winbind/wscript_build b/source4/winbind/wscript_build
index 5ba9c2a..e6710ce 100644
--- a/source4/winbind/wscript_build
+++ b/source4/winbind/wscript_build
@@ -10,6 +10,14 @@ bld.SAMBA_MODULE('service_winbind',
internal_module=False,
)
+bld.SAMBA_MODULE('service_winbindd',
+ source='winbindd.c',
+ subsystem='service',
+ init_function='server_service_winbindd_init',
+ deps='process_model UTIL_RUNCMD',
+ internal_module=False,
+ )
+
bld.SAMBA_SUBSYSTEM('WB_HELPER',
source='wb_async_helpers.c wb_utils.c',
--
Samba Shared Repository
More information about the samba-cvs
mailing list