Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backslashes in a password need to be escaped
This will replace a single backslash with a double backslash in the `/root/.mongoshrc.js` file. when a password with a backslash is used, it is correctly passed on to the provider for setting the user's password, but things break when attempting to use said password for the admin user. A small explanation on the amount of backslashes: The first argument is a regular expression, so we need to escape the backslash. The second argument allows for references to capture groups or the entire match using backslashes, for example `\0` contains the entire match. This would make us end up with 4 backslashes, but apparantly the template rendering also has backslash escaping, this we need to double the amount of backslashes. So 8 in total.
- Loading branch information