Skip to content

Commit 7f34892

Browse files
committed
allow password to be an empty string
1 parent e9ef446 commit 7f34892

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/third_party/tp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ static inline char *
12741274
tp_auth(struct tp *p, const char *salt_base64, const char *user, int ulen, const char *pass, int plen)
12751275
{
12761276
//char guest = (strncmp(user, "guest", 6) == 0);
1277-
char nopass = (plen == 0);
1277+
char nopass = (pass == NULL);
12781278
int sz = 5 +
12791279
mp_sizeof_map(2) +
12801280
mp_sizeof_uint(TP_CODE) +

test/CreateTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ public function test_07_bad_guest_cridentials()
109109
$c->authenticate('guest', 'guest');
110110
}
111111

112+
/**
113+
* @expectedException Exception
114+
* @expectedExceptionMessage Query error
115+
*/
116+
public function test_07_01_bad_guest_cridentials()
117+
{
118+
$c = new Tarantool('localhost', self::$port);
119+
$c->connect();
120+
$this->assertTrue($c->ping());
121+
$c->authenticate('guest', '');
122+
}
123+
112124
public function test_08_good_cridentials()
113125
{
114126
$c = new Tarantool('localhost', self::$port);

0 commit comments

Comments
 (0)