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

2023-12-21 Thread Werner Koch via Gnupg-users
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


openpgp-digital-signature.asc
Description: PGP signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users


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

2023-12-21 Thread Jeff Bailey
Hi!  I'm trying to make a script resilient against a bad gnupg.conf file,
so I tried passing --no-options to it.  However, it then caused the command
to fail on machines where gnupg had never been run, so ~/.gnupg didn't
exist yet with the following error:

gpg: Fatal: /home/jbailey/.gnupg: directory does not exist!

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
homedir, or perhaps should --no-options skip doing anything with
trustdb.gpg.

Or perhaps I'm wrong on how I'm thinking about this.

Thank you!
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users