Browse Source

fix unescaped single quote in password

master
Andrew Kaiser 6 years ago
parent
commit
a361ae9c07
3 changed files with 4 additions and 4 deletions
  1. +1
    -1
      bin/cli.js
  2. +1
    -1
      package.json
  3. +2
    -2
      src/index.js

+ 1
- 1
bin/cli.js View File

@ -4,7 +4,7 @@ const os = require('os')
const path = require('path')
const { exec } = require('child_process')
const minimist = require('minimist')
const menu = require('../src/index')
const menu = require('../src')
const scheduleCleanup = require('../src/schedule-cleanup')
const cachePasswordDefault = 15


+ 1
- 1
package.json View File

@ -1,6 +1,6 @@
{
"name": "bitwarden-dmenu",
"version": "1.1.3",
"version": "1.1.4",
"description": "dmenu for bitwarden password manager.",
"keywords": [
"bitwarden",


+ 2
- 2
src/index.js View File

@ -21,7 +21,7 @@ const getSessionVar = async ({ saveSession, sessionFile }) => {
// prompt for password in dmenu
const password = await dmenuRun('\n', '-p Password: -nf black -nb black')
if (!password) throw new Error('no password given!')
const session = bwRun(`unlock '${password}' --raw`)
const session = bwRun(`unlock $'${password.replace(`'`, `\\'`)}' --raw`)
writeFileSync(sessionFile, session)
console.debug('saved new session file.')
return session
@ -29,7 +29,7 @@ const getSessionVar = async ({ saveSession, sessionFile }) => {
} else {
const password = await dmenuRun('\n', '-p Password: -nf black -nb black')
if (!password) throw new Error('no password given!')
const session = bwRun(`unlock '${password}' --raw`)
const session = bwRun(`unlock $'${password.replace(`'`, `\\'`)}' --raw`)
return session
}
}


Loading…
Cancel
Save