mattydebie/bitwarden-rofi

keyctl: Permission Denied

pltanton opened this issue ยท 9 comments

While trying to call bwmenu I got:

keyctl_set_timeout: Permission denied
keyctl_read_alloc: Permission denied

Previous thread: #28

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

systemd/systemd#5522 might be useful?

d3vv3 commented

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

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

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

Anyone solve this / have a workaround?

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.

I confirm keyctl link @u @s solves the problem

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>

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"
}