dyne / tomb

the Crypto Undertaker
https://dyne.org/software/tomb
GNU General Public License v3.0
1.32k stars 151 forks source link

tomb --version and tomb-kdb-pbkdf2 #484

Closed nerun closed 10 months ago

nerun commented 1 year ago

Running both Tomb v2.9 and 2.10 in the same system with tomb-kdb-pbkdf2 installed, version 2.9 finds it, but 2.10 don't:

tom-kdb-pbkdf2

Why not?

Narrat commented 1 year ago

Good question. The part that is responsible for printing those didn't change between 2.9.0 and current master. And for me it works:

/usr/bin/gettext
dcfldd not found
/usr/bin/shred
steghide not found
/usr/bin/resize2fs
/usr/bin/tomb-kdb-pbkdf2
/usr/bin/argon2
qrencode not found
swish-e not found
unoconv not found
/usr/bin/lsof
nerun commented 1 year ago

When i use 2.9 it works, but 2.10 not. But you are right. It make no sense. The function responsible for printing those didn't change.

But i can see you have installed tomb-kdb-pbkdf2 in /usr/bin not in /usr/libexec/tomb. In /usr/bin it will always work. My doubt is why 2.9 can find something inside /usr/libexec/tomb and 2.10 can't!

Default packages for Ubuntu/Mint for version 2.9 install it in /usr/libexec/tomb. Why are yours tomb-kdb-pbkdf2 installed in /usr/bin? Which folder is the right one?

Narrat commented 1 year ago

As it uses which under the hood it doesn't make any difference from which version of shellscript it is called. You're testing both outputs on the same machine?

A rather innocent question, but let me tell you it can start wars ;) :D /usr/libexec is defined by the FHS as Binaries run by other programs (optional). It is purely optional. My distro never seemed to have really adopted it. Instead one is advised the following:

Avoid using /usr/libexec/ for anything. Use /usr/lib/$pkgname/ instead.

I maintain the scripts for creating packages for Arch which does the following:

make DESTDIR="${pkgdir}" PREFIX=/usr install

It just uses the provided Makefile to install the parts into the locations upstream seemed preferable. Which are per default: install -Dm755 tomb-kdb-pbkdf2 ${DESTDIR}${PREFIX}/bin/tomb-kdb-pbkdf2 I don't know who packaged Tomb for Mint/Ubuntu or subsequently Debian but it seems it was thought /usr/libexec would be a more fitting place. It really depends on the question if it should be available from $PATH and has some general use. That being said the FHS states: /usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts. Tomb being a shell script which calls this binary directly... Literal meaning would mean that /usr/libexec is the wrong place. On the other hand it is prefixed with tomb-. In other words: It isn't that easy sometimes. And as I said in the beginning. Discussions about the FHS tend to get messy :D The /usr-merge is still somewhat of a battleground.

nerun commented 1 year ago

As it uses which under the hood it doesn't make any difference from which version of shellscript it is called. You're testing both outputs on the same machine?

Yes! SAME machine!

Anyway, GREAT explanation! 👏

Narrat commented 1 year ago

Odd... One question @jaromil as I'm far from firm in regards of shell programming. Does ZSH have builtin options which can be set to restrict what folders gets searched?

jaromil commented 1 year ago

zsh hashes locations of commands, after every change to PATH a 'rehash' command needs to refresh the hash table.

nerun commented 10 months ago

I don't know what's happened, but it's now working!

/bin/tomb -v          
  Tomb 2.10.0 - um agente funerário forte e gentil para os seus segredos

   Copyright (C) 2007-2021 Dyne.org Foundation, Licença GNU GPL v3+
   Este é um software livre: você é livre para alterá-lo e redistribuí-lo
   Para obter o código-fonte mais atual, acesse <http://dyne.org/software/tomb>

   Este código-fonte é distribuído na esperança de que seja útil,
   mas SEM QUALQUER GARANTIA; nem mesmo a garantia implícita de
   COMERCIABILIDADE ou ADEQUAÇÃO A UM DETERMINADO FIM.
   Quando necessário, por favor consulte <http://dyne.org/support>.

  Utilitários de sistema:

  zsh 5.8.1 (x86_64-ubuntu-linux-gnu)
  Sudo versão 1.9.9
  cryptsetup 2.4.3
  pinentry-gnome3 (pinentry) 1.1.1
  findmnt de util-linux 2.37.2
  gpg (GnuPG) 2.2.27 - key forging algorithms (GnuPG symmetric ciphers):
  IDEA 3DES CAST5 BLOWFISH AES AES192 AES256 TWOFISH CAMELLIA128 CAMELLIA192 CAMELLIA256

  Utilitários opcionais:

  /usr/bin/gettext
  /usr/bin/dcfldd
  /usr/bin/shred
  /usr/bin/steghide
  /usr/sbin/resize2fs
  /usr/bin/tomb-kdb-pbkdf2
  /usr/bin/argon2
  /usr/bin/qrencode
  /usr/bin/swish-e
  /usr/bin/unoconv
  /usr/bin/lsof