summaryrefslogtreecommitdiff
path: root/source4/winbind/wb_server.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-10-09 12:50:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:35 -0500
commitb468ba1386166cfe2f026051b205468de1c6103e (patch)
tree9edc20f9e02afaf0447701e8d83875a1d0b89642 /source4/winbind/wb_server.c
parent8aff6e005e36c21ebc9dd5a0dcd41f1c0d5c9c2f (diff)
downloadsamba-b468ba1386166cfe2f026051b205468de1c6103e.tar.gz
samba-b468ba1386166cfe2f026051b205468de1c6103e.tar.bz2
samba-b468ba1386166cfe2f026051b205468de1c6103e.zip
r10846: Create a "wbsrv_domain", change wb_finddcs to the style of the rest of the
async helpers. Volker (This used to be commit 10585ba4e81e979a03aec747db6fc059978fa566)
Diffstat (limited to 'source4/winbind/wb_server.c')
-rw-r--r--source4/winbind/wb_server.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/source4/winbind/wb_server.c b/source4/winbind/wb_server.c
index 3959153b05..dd6d3bcf84 100644
--- a/source4/winbind/wb_server.c
+++ b/source4/winbind/wb_server.c
@@ -248,6 +248,30 @@ static const struct wbsrv_protocol_ops wbsrv_samba3_protocol_ops = {
.push_reply = wbsrv_samba3_push_reply
};
+static NTSTATUS init_my_domain(TALLOC_CTX *mem_ctx,
+ struct wbsrv_domain **domain)
+{
+ struct wbsrv_domain *result;
+
+ result = talloc_zero(mem_ctx, struct wbsrv_domain);
+ NT_STATUS_HAVE_NO_MEMORY(result);
+
+ result->name = talloc_strdup(result, lp_workgroup());
+ if (result->name == NULL) {
+ talloc_free(result);
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ result->sid = secrets_get_domain_sid(result, lp_workgroup());
+ if (result->sid == NULL) {
+ talloc_free(result);
+ return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
+ }
+
+ *domain = result;
+ return NT_STATUS_OK;
+}
+
/*
startup the winbind task
*/
@@ -278,6 +302,14 @@ static void winbind_task_init(struct task_server *task)
if (!service) goto nomem;
service->task = task;
+ status = init_my_domain(service, &service->domains);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("Could not init my domain: %s\n",
+ nt_errstr(status)));
+ task_server_terminate(task, nt_errstr(status));
+ return;
+ }
+
/* setup the unprivileged samba3 socket */
listen_socket = talloc(service, struct wbsrv_listen_socket);
if (!listen_socket) goto nomem;