You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by ph...@apache.org on 2009/08/04 03:58:22 UTC
svn commit: r800653 - in /hadoop/zookeeper/branches/branch-3.2: CHANGES.txt
src/c/src/zookeeper.c src/c/tests/TestClient.cc
Author: phunt
Date: Tue Aug 4 01:58:22 2009
New Revision: 800653
URL: http://svn.apache.org/viewvc?rev=800653&view=rev
Log:
ZOOKEEPER-466. crash on zookeeper_close() when using auth with empty cert
Modified:
hadoop/zookeeper/branches/branch-3.2/CHANGES.txt
hadoop/zookeeper/branches/branch-3.2/src/c/src/zookeeper.c
hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClient.cc
Modified: hadoop/zookeeper/branches/branch-3.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.2/CHANGES.txt?rev=800653&r1=800652&r2=800653&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.2/CHANGES.txt (original)
+++ hadoop/zookeeper/branches/branch-3.2/CHANGES.txt Tue Aug 4 01:58:22 2009
@@ -26,8 +26,11 @@
ZOOKEEPER-481. Add lastMessageSent to QuorumCnxManager. (flavio via mahadev)
- ZOOKEEPER-479. QuorumHierarchical does not count groups correctly (flavio
-via mahadev)
+ ZOOKEEPER-479. QuorumHierarchical does not count groups correctly
+ (flavio via mahadev)
+
+ ZOOKEEPER-466. crash on zookeeper_close() when using auth with empty cert
+ (Chris Darroch via phunt)
IMPROVEMENTS:
Modified: hadoop/zookeeper/branches/branch-3.2/src/c/src/zookeeper.c
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.2/src/c/src/zookeeper.c?rev=800653&r1=800652&r2=800653&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.2/src/c/src/zookeeper.c (original)
+++ hadoop/zookeeper/branches/branch-3.2/src/c/src/zookeeper.c Tue Aug 4 01:58:22 2009
@@ -2674,8 +2674,7 @@
zoo_lock_auth(zh);
authinfo = (auth_info*) malloc(sizeof(auth_info));
authinfo->scheme=strdup(scheme);
- if(auth.buff)
- authinfo->auth=auth;
+ authinfo->auth=auth;
authinfo->completion=completion;
authinfo->data=data;
authinfo->next = NULL;
Modified: hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClient.cc
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClient.cc?rev=800653&r1=800652&r2=800653&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClient.cc (original)
+++ hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClient.cc Tue Aug 4 01:58:22 2009
@@ -423,7 +423,7 @@
void testAuth() {
int rc;
count = 0;
- watchctx_t ctx1, ctx2, ctx3;
+ watchctx_t ctx1, ctx2, ctx3, ctx4;
zhandle_t *zk = createClient(&ctx1);
struct ACL_vector nodeAcl;
struct ACL acl_val;
@@ -444,6 +444,21 @@
rc = zoo_create(zk, "/tauth1", "", 0, &ZOO_CREATOR_ALL_ACL, 0, 0, 0);
CPPUNIT_ASSERT_EQUAL((int)ZOK, rc);
+ {
+ //create a new client
+ zk = createClient(&ctx4);
+ rc = zoo_add_auth(zk, "digest", "", 0, voidCompletion, (void*)ZOK);
+ CPPUNIT_ASSERT_EQUAL((int) ZOK, rc);
+ waitForVoidCompletion(3);
+ CPPUNIT_ASSERT(count == 0);
+
+ rc = zoo_add_auth(zk, "digest", "", 0, voidCompletion, (void*)ZOK);
+ CPPUNIT_ASSERT_EQUAL((int) ZOK, rc);
+ waitForVoidCompletion(3);
+ CPPUNIT_ASSERT(count == 0);
+ }
+
+ //create a new client
zk = createClient(&ctx2);
rc = zoo_add_auth(zk, "digest", "pat:passwd2", 11, voidCompletion,