Commit 0428248
committed
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.1 parent 3c22469 commit 0428248
2 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
455 | 471 | | |
456 | 472 | | |
457 | 473 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
0 commit comments