summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_dual.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/winbindd/winbindd_dual.c')
-rw-r--r--source3/winbindd/winbindd_dual.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 15ca564c6a..2b756b24d1 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -34,20 +34,22 @@
#define DBGC_CLASS DBGC_WINBIND
extern bool override_logfile;
+extern struct winbindd_methods cache_methods;
/* Read some data from a client connection */
static void child_read_request(struct winbindd_cli_state *state)
{
- ssize_t len;
+ NTSTATUS status;
/* Read data */
- len = read_data(state->sock, (char *)&state->request,
- sizeof(state->request), NULL);
+ status = read_data(state->sock, (char *)&state->request,
+ sizeof(state->request));
- if (len != sizeof(state->request)) {
- DEBUG(len > 0 ? 0 : 3, ("Got invalid request length: %d\n", (int)len));
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(3, ("child_read_request: read_data failed: %s\n",
+ nt_errstr(status)));
state->finished = True;
return;
}
@@ -71,11 +73,12 @@ static void child_read_request(struct winbindd_cli_state *state)
/* Ensure null termination */
state->request.extra_data.data[state->request.extra_len] = '\0';
- len = read_data(state->sock, state->request.extra_data.data,
- state->request.extra_len, NULL);
+ status= read_data(state->sock, state->request.extra_data.data,
+ state->request.extra_len);
- if (len != state->request.extra_len) {
- DEBUG(0, ("Could not read extra data\n"));
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("Could not read extra data: %s\n",
+ nt_errstr(status)));
state->finished = True;
return;
}
@@ -767,7 +770,7 @@ static void account_lockout_policy_handler(struct event_context *ctx,
(struct winbindd_child *)private_data;
TALLOC_CTX *mem_ctx = NULL;
struct winbindd_methods *methods;
- SAM_UNK_INFO_12 lockout_policy;
+ struct samr_DomInfo12 lockout_policy;
NTSTATUS result;
DEBUG(10,("account_lockout_policy_handler called\n"));
@@ -1081,6 +1084,16 @@ static bool fork_domain_child(struct winbindd_child *child)
child);
}
+ /* Special case for Winbindd on a Samba DC,
+ * We want to make sure the child can connect to smbd
+ * but not the main daemon */
+
+ if (child->domain && child->domain->internal && IS_DC) {
+ child->domain->internal = False;
+ child->domain->methods = &cache_methods;
+ child->domain->online = False;
+ }
+
while (1) {
int ret;