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.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'xlators/protocol/client/src/client.c') diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 80a2d4d3461..97d9644342e 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -53,8 +53,19 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame, int count = 0; char new_iobref = 0, start_ping = 0; + if (!this || !prog || !frame) + goto out; + conf = this->private; + /* If 'setvolume' is not successful, we should not send frames to + server, mean time we should be able to send 'DUMP' and 'SETVOLUME' + call itself even if its not connected */ + if (!(conf->connected || + ((prog->prognum == GLUSTER_DUMP_PROGRAM) || + ((prog->prognum == GLUSTER_HNDSK_PROGRAM) && (procnum == GF_HNDSK_SETVOLUME))))) + goto out; + iobuf = iobuf_get (this->ctx->iobuf_pool); if (!iobuf) { goto out; @@ -102,11 +113,11 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame, ret = 0; out: - if (new_iobref) { + if (new_iobref) iobref_unref (iobref); - } - iobuf_unref (iobuf); + if (iobuf) + iobuf_unref (iobuf); return ret; } -- cgit