{ WINBINDD_LIST_TRUSTDOM, winbindd_list_trusted_domains,
"LIST_TRUSTDOM" },
- /* Lookup related functions */
-
- { WINBINDD_REMOVE_MAPPING, winbindd_remove_mapping, "REMOVE_MAPPING" },
- { WINBINDD_SET_HWM, winbindd_set_hwm, "SET_HWMS" },
-
/* Miscellaneous */
{ WINBINDD_INFO, winbindd_info, "INFO" },
/* Credential cache access */
{ WINBINDD_CCACHE_NTLMAUTH, winbindd_ccache_ntlm_auth, "NTLMAUTH" },
+ { WINBINDD_CCACHE_SAVE, winbindd_ccache_save, "CCACHE_SAVE" },
/* WINS functions */
winbindd_list_groups_send, winbindd_list_groups_recv },
{ WINBINDD_CHECK_MACHACC, "CHECK_MACHACC",
winbindd_check_machine_acct_send, winbindd_check_machine_acct_recv },
+ { WINBINDD_PING_DC, "PING_DC",
+ winbindd_ping_dc_send, winbindd_ping_dc_recv },
{ 0, NULL, NULL, NULL }
};
winbindd_allocate_gid_send, winbindd_allocate_gid_recv },
{ WINBINDD_SET_MAPPING, "SET_MAPPING",
winbindd_set_mapping_send, winbindd_set_mapping_recv },
+ { WINBINDD_REMOVE_MAPPING, "SET_MAPPING",
+ winbindd_remove_mapping_send, winbindd_remove_mapping_recv },
+ { WINBINDD_SET_HWM, "SET_HWM",
+ winbindd_set_hwm_send, winbindd_set_hwm_recv },
+ { WINBINDD_CHANGE_MACHACC, "CHANGE_MACHACC",
+ winbindd_change_machine_acct_send, winbindd_change_machine_acct_recv },
{ 0, NULL, NULL, NULL }
};
ret = wb_resp_write_recv(req, &err);
TALLOC_FREE(req);
if (ret == -1) {
+ close(state->sock);
+ state->sock = -1;
DEBUG(2, ("Could not write response to client: %s\n",
strerror(err)));
remove_client(state);
ret = wb_req_read_recv(req, state, &state->request, &err);
TALLOC_FREE(req);
if (ret == -1) {
- DEBUG(2, ("Could not read client request: %s\n",
- strerror(err)));
+ if (err == EPIPE) {
+ DEBUG(6, ("closing socket %d, client exited\n",
+ state->sock));
+ } else {
+ DEBUG(2, ("Could not read client request from fd %d: "
+ "%s\n", state->sock, strerror(err)));
+ }
+ close(state->sock);
+ state->sock = -1;
remove_client(state);
return;
}
return;
}
- /* tell client, we are closing ... */
- nwritten = write(state->sock, &c, sizeof(c));
- if (nwritten == -1) {
- /*
- * ignore EPIPE error here, because the other end might
- * have already closed the socket.
- */
- if (errno != EPIPE) {
+ if (state->sock != -1) {
+ /* tell client, we are closing ... */
+ nwritten = write(state->sock, &c, sizeof(c));
+ if (nwritten == -1) {
DEBUG(2, ("final write to client failed: %s\n",
- strerror(errno)));
+ strerror(errno)));
}
- }
-
- /* Close socket */
- close(state->sock);
+ /* Close socket */
- /* Free any getent state */
-
- free_getent_state(state->getgrent_state);
+ close(state->sock);
+ state->sock = -1;
+ }
TALLOC_FREE(state->mem_ctx);
for (state = winbindd_client_list(); state; state = state->next) {
if (state->response == NULL &&
- !state->pwent_state && !state->getgrent_state) {
+ !state->pwent_state && !state->grent_state) {
nidle++;
if (!last_access || state->last_access < last_access) {
last_access = state->last_access;