mattydebie / bitwarden-rofi

Wrapper for Bitwarden https://github.com/bitwarden/cli and Rofi
GNU General Public License v3.0
351 stars 57 forks source link

keyctl: Permission Denied #34

Closed pltanton closed 3 years ago

pltanton commented 4 years ago

While trying to call bwmenu I got:

keyctl_set_timeout: Permission denied
keyctl_read_alloc: Permission denied

Previous thread: #28

kylesferrazza commented 4 years ago

I've got the same issue running systemd 243.

Reading a key from @u seems to fail, even as root:

$ keyctl padd user bw_session @u
test
988710383

$ keyctl read 988710383
keyctl_read_alloc: Permission denied

https://github.com/systemd/systemd/issues/5522 might be useful?

d3vv3 commented 4 years ago

I am here as well, there is a closed issue regarding this, but it isn't solved (?)

pltanton commented 4 years ago

Can we implement a fork or an option to store secrets with another secret storage provider like gnome-keyring org kwallet?

arekceg commented 4 years ago

Same issue here: keyctl_set_timeout: Permission denied keyctl_read_alloc: Permission denied

Works well on my laptop with Manjaro but will not work on my PC running Mint

kylesferrazza commented 4 years ago

Anyone solve this / have a workaround?

trevorriles commented 4 years ago

I solved this by installing keyutils and running keyctl link @u @s after logging into the cli. That linked the secret in my user key ring to my session keyring which bwmenu can access.

symphorien commented 4 years ago

I confirm keyctl link @u @s solves the problem

tashrifbillah commented 10 months ago

I confirm keyctl link @u @s solves the problem

Does not work for me on a CentOS 7 Linux. I still get permission denied on keyctl timeout <keyring> <timeout>

TSoli commented 10 months ago

I confirm keyctl link @u @s solves the problem

Yep me too (on Linux Mint). Just in case anyone is not sure how to include this in the program automatically just open up bwmenu with vim or something and change the ask_password() function like so

ask_password() {
  rm $CACHE_FILE
  mpw=$(printf '' | rofi -dmenu -p "Master Password" -password -l 0 ${ROFI_OPTIONS[@]}) || exit $?
  if ! out="$(bw --raw --nointeraction unlock "$mpw" 2>&1)"; then
    exit_error 1 "Could not unlock vault: $out"
  fi
  keyctl link @u @s  # Add this line
  echo "$out"
}