--list-keys fails with missing .gnupg directory and --no-options

Werner Koch wk at gnupg.org
Thu Dec 21 16:04:06 CET 2023


Hi!

Right, no-options also inhibits the homedir creation:

       --no-options
       
              Shortcut for --options /dev/null. This option is detected
              before an attempt to open an option file.  Using this op‐
              tion will also prevent the creation of a ‘~/.gnupg’
              homedir.

> I'm wondering if the documentation for --no-options should perhaps be
> updated to indicate that commands like --list-keys may fail if there's no

I think that most commands will fail without a homedir.

> homedir, or perhaps should --no-options skip doing anything with
> trustdb.gpg.

Well, if the homedir exists - which is the common case - this would
change behaviour.  --no-options is used so that you don't accidently use
configured options like --encrypt-to or similar.  For example, dirmngr
and gpg-wks-client have such needs.

I would suggest to create a temporary home directory or disable the
trust thing (--always-trust should work).  But without a home directory
many things can't work.

BTW, if case you are writing a verification script, have a look at the
new option --assert-signer.


Salam-Shalom,

   Werner

-- 
The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 247 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20231221/984596c9/attachment-0001.sig>


More information about the Gnupg-users mailing list