Fix for whitespace in DB password text #143
Fix for whitespace in DB password text #143tanmally wants to merge 1 commit intodatabacker:masterfrom
Conversation
This removes all whitespace in db password (denoted by [:space:] in tr) For eg : " test Passw0rd " will be modified to "testPassw0rd" . This removes leading, trailing, and intermediate whitespace in password .
|
I have a question. Is this the right approach? I agree (mostly) with leading and trailing whitespace, but what about whitespace in the middle? Is
Would it make more sense to include the password in single quotes, so that they get passed as a single arg? |
|
What you have mentioned is something I thought of initially and I went with the approach
The reason I went with trimming the white space in between the password is to avoid the issue when read from .env file like the ones mentioned below |
|
I can see how trimming whitespace at beginning and end would be right (again, I am not 100% sure of this), but if someone put whitespace in the middle, it is highly likely they intended to. I wouldn't want us to be in a place of second-guessing what they chose to do. Any reason we cannot just go to quotes and not need to trim at all? |
This removes all whitespace in DB password (denoted by [:space:] in tr)
For eg: " test Passw0rd " will be modified to "testPassw0rd".
Note: This removes leading, trailing, and intermediate whitespace in password.