Skip to content

Commit

Permalink
Fixed escaping for weird chars in passwords. Wow. If this breaks agai…
Browse files Browse the repository at this point in the history
…n, i'm seriously going to reconsider my career choice.
  • Loading branch information
NeoTheThird committed Dec 10, 2017
1 parent a3d52d2 commit c3214ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ var checkPassword = (password, callback) => {
return;
}
log.debug("checking password")
exec("echo '" + password.replace("'", "\\'") + "' | sudo -S echo correct", (err, output) => {
exec("echo \"" + password.replace(/\"/g, "\\\"") + "\" | sudo -S echo correct", (err, output) => {
if(err){
if (err.message.includes("incorrect password")) {
log.debug("incorrect password")
Expand Down

0 comments on commit c3214ea

Please sign in to comment.