From dbab7f87b6fbcc4d1f518e6f98101331df51ce4a Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 23 Jul 2010 03:13:48 +0000 Subject: client protocol should send the fops only after handshake Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 1195 (crash in protocol server due to unauthenticated fop request..) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1195 --- xlators/protocol/client/src/client-handshake.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'xlators/protocol/client/src/client-handshake.c') diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 31690ef17b8..69035d458ba 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -188,6 +188,8 @@ client_start_ping (void *data) ret = client_submit_request (this, NULL, frame, conf->handshake, GF_HNDSK_PING, client_ping_cbk, NULL, NULL); + if (ret) + goto fail; return; fail: @@ -292,6 +294,7 @@ int32_t client3_getspec (call_frame_t *frame, xlator_t *this, void *data) clnt_args_t *args = NULL; gf_getspec_req req = {0,}; int op_errno = ESTALE; + int ret = 0; if (!frame || !this || !data) goto unwind; @@ -301,9 +304,12 @@ int32_t client3_getspec (call_frame_t *frame, xlator_t *this, void *data) req.flags = args->flags; req.key = (char *)args->name; - client_submit_request (this, &req, frame, conf->handshake, GF_HNDSK_GETSPEC, + ret = client_submit_request (this, &req, frame, conf->handshake, GF_HNDSK_GETSPEC, client3_getspec_cbk, NULL, xdr_from_getspec_req); + if (ret) + goto unwind; + return 0; unwind: STACK_UNWIND_STRICT (getspec, frame, -1, op_errno, NULL); @@ -475,6 +481,7 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m op_ret = 0; conf->connecting = 0; + conf->connected = 1; /* TODO: more to test */ client_post_handshake (frame, frame->this); -- cgit