summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-11-14 20:02:02 +0000
committerJeremy Allison <jra@samba.org>2001-11-14 20:02:02 +0000
commit5d97ab9df86af7004572f227f47bd74a0830833d (patch)
tree69006a257cf4c9b0bf1254d1e5faf452cbdd0d28 /source3/nsswitch
parentb7f6113c2dcadef6a9cc123ce719171523f54d23 (diff)
downloadsamba-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')
-rw-r--r--source3/nsswitch/winbindd.c24
-rw-r--r--source3/nsswitch/winbindd_nss.h10
2 files changed, 24 insertions, 10 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 */
diff --git a/source3/nsswitch/winbindd_nss.h b/source3/nsswitch/winbindd_nss.h
index 20667b0a9b..a99e3b3e1f 100644
--- a/source3/nsswitch/winbindd_nss.h
+++ b/source3/nsswitch/winbindd_nss.h
@@ -59,13 +59,13 @@ enum winbindd_cmd {
/* PAM authenticate and password change */
WINBINDD_PAM_AUTH,
- WINBINDD_PAM_AUTH_CRAP,
+ WINBINDD_PAM_AUTH_CRAP,
WINBINDD_PAM_CHAUTHTOK,
/* List various things */
- WINBINDD_LIST_USERS, /* List w/o rid->id mapping */
- WINBINDD_LIST_GROUPS, /* Ditto */
+ WINBINDD_LIST_USERS, /* List w/o rid->id mapping */
+ WINBINDD_LIST_GROUPS, /* Ditto */
WINBINDD_LIST_TRUSTDOM,
/* SID conversion */
@@ -73,7 +73,7 @@ enum winbindd_cmd {
WINBINDD_LOOKUPSID,
WINBINDD_LOOKUPNAME,
- /* S*RS functions */
+ /* Lookup functions */
WINBINDD_SID_TO_UID,
WINBINDD_SID_TO_GID,
@@ -121,7 +121,7 @@ struct winbindd_request {
fstring name; /* lookupname */
uint32 num_entries; /* getpwent, getgrent */
} data;
- fstring domain; /* {set,get,end}{pw,gr}ent() */
+ fstring domain; /* {set,get,end}{pw,gr}ent() */
};
/* Response values */