roddhjav / pass-tomb

A pass extension that helps you keep the whole tree of passwords encrypted inside a Tomb.
https://www.passwordstore.org
GNU General Public License v3.0
378 stars 30 forks source link

Unable to set the timer #28

Closed amerlyq closed 3 years ago

amerlyq commented 5 years ago

Is it broken? I don't see any .timer file inside opened tomb.

run pass tomb gpgid --timer=2h OR pass open --timer=2h

  w  Unable to set the timer to close the password tomb in 2h.
 (*) Your password tomb has been opened in /home/amer/.password-store/.
  .  You can now use pass as usual.
  .  When finished, close the password tomb using 'pass close'.

My system:

Linux host 5.2.9-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 16 11:29:43 UTC 2019 x86_64 GNU/Linux
systemd 242 (242.84-2-arch)
+PAM +AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid
roddhjav commented 5 years ago

Hi, According to the program output, it was unable to setup the timer. Could you give me more information on the error by running pass open --timer=2h --verbose

amerlyq commented 5 years ago

Hi, I could reproduce the problem by spamming pass tomb && pass close && rm -rf ~/.password-store. Output:

  .  pass Opening the password tomb /home/user/.password.tomb using the key /home/user/.password.tomb.key
  .  tomb  .  Commanded to open tomb /home/user/.password.tomb
  .  tomb  .  An active swap partition is detected...
  .  tomb (*) The undertaker found that all swap partitions are encrypted. Good.
  .  tomb  .  Valid tomb file found: /home/user/.password.tomb
  .  tomb  .  Key is valid.
  .  tomb (*) Opening .password on /home/user/.password-store/
  .  tomb  .  This tomb is a valid LUKS encrypted device.
  .  tomb  .  Cipher is "aes" mode "xts-plain64" hash "sha512"
  .  tomb (*) Success unlocking tomb .password
  .  tomb  .  Checking filesystem via /dev/loop0
  .  fsck from util-linux 2.34
  .  .password: clean, 141/2048 files, 1505/8192 blocks
  .  tomb (*) Success opening .password.tomb on /home/user/.password-store/
  .  tomb  .  Last visit by user(1000) from /dev/pts/18 on NB-109
  .  tomb  .  on date Wed 28 Aug 2019 04:38:00 PM EEST
  .  pass Setting user permissions on /home/user/.password-store/
  .  pass Failed to start transient timer unit: Unit pass-close@.password.timer already exists.
  w  Unable to set the timer to close the password tomb in 2h.
 (*) Your password tomb has been opened in /home/user/.password-store/.
  .  You can now use pass as usual.
  .  When finished, close the password tomb using 'pass close'.

It seems silently stopping and recreating tomb-id specific timer would be the best? Because failing due to existing unit has little usefulness.

roddhjav commented 3 years ago

That should be fixed now.