[MDEV-4013] Password length in replication setup Created: 2013-01-08  Updated: 2013-01-10  Resolved: 2013-01-09

Status: Closed
Project: MariaDB Server
Component/s: None
Fix Version/s: 5.5.30

Type: Task Priority: Minor
Reporter: Elena Stepanova Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: upstream

Attachments: File rpl_password_boundaries.result     File rpl_password_boundaries.test    

 Description   

There was an IRC discussion on master_password length, and two points came up:

1. Max length for master password in replication setup is 32, Monty wanted to add an error if a longer one is used:

<montywi> elenst: would it be fast for you to do a rpl test that would test connecting with a password of 32 and then 33 ?
<montywi> That would allow me to quickly add an error message if one used change_master with too long password

2. If non-ascii symbols are used in the master password, it decreases the max length

<montywi> elenst: can you also add the above example to the mtr test.
<montywi> I assume this could be because the master_password in this case will not be threated as binary, as it probably should, but by the current connect character set
<montywi> hm, looks like it should be threated as binary. Strange...

So, I've attached an MTR test case with result file, which tries 4 replication passwords:

  • 32 ascii symbols, it's expected to work and it does;
  • 33 ascii symbols, it's not expected to work and it doesn't – one can set such a password in change_master, but IO thread won't connect. That's apparently where Monty wanted to add an error – so that one couldn't make a mistake setting a too long password;
  • 16 cyrillic symbols, it's expected to work and it does, as long as slave has NAMES utf8;
  • 16 cyrillic symbols + 1 ascii symbol: I don't know if it's expected to work or not, the conclusion wasn't clear; currently it doesn't, and that's how the test was created, it expects start slave to fail when such password is configured. If that's wrong behavior, the test will need to be modified.


 Comments   
Comment by Elena Stepanova [ 2013-01-08 ]

Server behavior in MySQL 5.5.28 is the same, but a typo in MySQL's include/wait_for_slave_param.inc doesn't allow the same test case to work on MySQL (fixed in maria/5.5 by knielsen, revno: 3178 revision-id: knielsen@knielsen-hq.org-20111214110203-nl2k00i85g16cnvj).

Comment by Michael Widenius [ 2013-01-09 ]

I have now added error checking and a proper error message if MASTER_HOST, MASTER_USER or MASTER_PASSWORD exceed the expected length.

Comment by Michael Widenius [ 2013-01-09 ]

I also extended length of MASTER_HOST and MASTER_PASSWORD to be able to handle at least
32 characters in any, up to 3-bytes per character, language.

Comment by Michael Widenius [ 2013-01-09 ]

Fixed

Generated at Thu Feb 08 06:53:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.