diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-06-20 13:42:29 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:20 -0500 |
commit | b62247f1eee94cadcf293084ce747c4b58aa1ac5 (patch) | |
tree | 9c32eda3836675166c7d791cfcef365d99dec5ce /source3/nsswitch/winbindd_wins.c | |
parent | e6ef7ba7a4bc79dbc98119abc5cb9bd72d43c2a4 (diff) | |
download | samba-b62247f1eee94cadcf293084ce747c4b58aa1ac5.tar.gz samba-b62247f1eee94cadcf293084ce747c4b58aa1ac5.tar.bz2 samba-b62247f1eee94cadcf293084ce747c4b58aa1ac5.zip |
r7785: This looks much larger than it is. It changes the top-level functions of the
parent winbind not to return winbindd_result. This is to hopefully fix all the
problems where a result has been scheduled for write twice.
The problematic ones have been the functions that might have been delayed as
well as under other circumstances immediately gets answered from the cache.
Now a request needs to be explicitly replied to with a request_error() or
request_ok().
Volker
(This used to be commit 7365c9accf98ec1dd78a59dd7f62462bbb8528d4)
Diffstat (limited to 'source3/nsswitch/winbindd_wins.c')
-rw-r--r-- | source3/nsswitch/winbindd_wins.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/source3/nsswitch/winbindd_wins.c b/source3/nsswitch/winbindd_wins.c index f199ebcb43..2e03becd5a 100644 --- a/source3/nsswitch/winbindd_wins.c +++ b/source3/nsswitch/winbindd_wins.c @@ -132,7 +132,7 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count) /* Get hostname from IP */ -enum winbindd_result winbindd_wins_byip(struct winbindd_cli_state *state) +void winbindd_wins_byip(struct winbindd_cli_state *state) { fstring response; int i, count, maxlen, size; @@ -151,7 +151,8 @@ enum winbindd_result winbindd_wins_byip(struct winbindd_cli_state *state) size = strlen(state->request.data.winsreq); if (size > maxlen) { SAFE_FREE(status); - return WINBINDD_ERROR; + request_error(state); + return; } fstrcat(response,state->request.data.winsreq); fstrcat(response,"\t"); @@ -162,7 +163,8 @@ enum winbindd_result winbindd_wins_byip(struct winbindd_cli_state *state) size = sizeof(status[i].name) + strlen(response); if (size > maxlen) { SAFE_FREE(status); - return WINBINDD_ERROR; + request_error(state); + return; } fstrcat(response, status[i].name); fstrcat(response, " "); @@ -173,12 +175,12 @@ enum winbindd_result winbindd_wins_byip(struct winbindd_cli_state *state) SAFE_FREE(status); } fstrcpy(state->response.data.winsresp,response); - return WINBINDD_OK; + request_ok(state); } /* Get IP from hostname */ -enum winbindd_result winbindd_wins_byname(struct winbindd_cli_state *state) +void winbindd_wins_byname(struct winbindd_cli_state *state) { struct in_addr *ip_list; int i, count, maxlen, size; @@ -200,7 +202,8 @@ enum winbindd_result winbindd_wins_byname(struct winbindd_cli_state *state) size = strlen(addr); if (size > maxlen) { SAFE_FREE(ip_list); - return WINBINDD_ERROR; + request_error(state); + return; } if (i != 0) { /* Clear out the newline character */ @@ -215,15 +218,18 @@ enum winbindd_result winbindd_wins_byname(struct winbindd_cli_state *state) size = strlen(state->request.data.winsreq) + strlen(response); if (size > maxlen) { SAFE_FREE(ip_list); - return WINBINDD_ERROR; + request_error(state); + return; } fstrcat(response,state->request.data.winsreq); fstrcat(response,"\n"); SAFE_FREE(ip_list); - } else - return WINBINDD_ERROR; + } else { + request_error(state); + return; + } fstrcpy(state->response.data.winsresp,response); - return WINBINDD_OK; + request_ok(state); } |