diff options
author | Jeremy Allison <jra@samba.org> | 2001-11-14 20:02:02 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-11-14 20:02:02 +0000 |
commit | 5d97ab9df86af7004572f227f47bd74a0830833d (patch) | |
tree | 69006a257cf4c9b0bf1254d1e5faf452cbdd0d28 /source3/nsswitch/winbindd.c | |
parent | b7f6113c2dcadef6a9cc123ce719171523f54d23 (diff) | |
download | samba-5d97ab9df86af7004572f227f47bd74a0830833d.tar.gz samba-5d97ab9df86af7004572f227f47bd74a0830833d.tar.bz2 samba-5d97ab9df86af7004572f227f47bd74a0830833d.zip |
Got ready to implement Martin's idea, but request doesn't have a length
field.... well, now at least the code is there when it does :-).
Jeremy.
(This used to be commit 22e323ca47325482b6ae527070509ed9c6cbccee)
Diffstat (limited to 'source3/nsswitch/winbindd.c')
-rw-r--r-- | source3/nsswitch/winbindd.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c index b37fdb1a4f..fb3309ec33 100644 --- a/source3/nsswitch/winbindd.c +++ b/source3/nsswitch/winbindd.c @@ -602,7 +602,7 @@ static void process_loop(int accept_sock) /* Process activity on client connections */ - for (state = client_list; state; state = state->next) { + for (state = client_list; state; ) { /* Data available for reading */ @@ -613,17 +613,29 @@ static void process_loop(int accept_sock) client_read(state); #if 0 - /* If we have the start of a + /* JRA - currently there's no length field in the request... */ + /* + * If we have the start of a * packet, then check the * length field to make sure * the client's not talking - * Mock Swedish. */ + * Mock Swedish. + */ + if (state->read_buf_len >= sizeof(int) && *(int *) state->buf != sizeof(state->request)) { - BORK_BORK_BORK(); + + struct winbindd_cli_state *rem_state = state; + + DEBUG(0,("process_loop: Invalid request size (%d) send, should be (%d)\n", + *(int *) rem_state->buf, sizeof(rem_state->request) )); + + state = state_next; + remove_client(rem_state); + continue; } #endif - + /* A request packet might be complete */ @@ -631,6 +643,8 @@ static void process_loop(int accept_sock) sizeof(state->request)) { process_packet(state); } + + state = state->next; } /* Data available for writing */ |