Skip to content

Commit

Permalink
[CONJ-725] Connection Failure when using PAM authenticated user on 10…
Browse files Browse the repository at this point in the history
….4 MariaDB server
  • Loading branch information
rusher committed Sep 13, 2019
1 parent af9d9cc commit 924d362
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ public SendPamAuthPacket(String password, byte[] authData, String passwordCharac
*/
public Buffer process(PacketOutputStream out, PacketInputStream in, AtomicInteger sequence)
throws IOException, SQLException {
int type = authData[0];
int type = authData.length == 0 ? 0 : authData[0];
String promptb;
//conversation is :
// - first byte is information tell if question is a password or clear text.
// - other bytes are the question to user

while (true) {
promptb = new String(Arrays.copyOfRange(authData, 1, authData.length));
if ("Password: ".equals(promptb) && password != null && !"".equals(password)) {
promptb = authData.length <= 1 ? null : new String(Arrays.copyOfRange(authData, 1, authData.length));
if ((promptb == null || "Password: ".equals(promptb)) && password != null && !"".equals(password)) {
//ask for password
out.startPacket(sequence.incrementAndGet());
byte[] bytePwd;
Expand Down

0 comments on commit 924d362

Please sign in to comment.