Page MenuHome GnuPG

The home directory ~/.gnupg is invalid
Closed, ResolvedPublic

Description

Release: GNUPG_HOMEDIR

Environment

Unix (IRIX)

Description

The default value for GNUPG_HOMEDIR is ~/.gnupg
This is not valid since ~ is a meta character, which
is expanded by csh,tcsh and bash - but not by other
shells like sh nor by the libc!
The real homedir must be read with libcalls like
getpwnam(3).
In the gpg source file openfile.c is a function
try_make_homedir() with a call to mkdir("~/.gnupg",...)
which cannot succeed. If i use gpg called by another prgramm and not in sh context, i get the error message:
gpg: fatal: can't create directory '~/.gnupg': No such file or directory
A workaround is to use the --homedir option or the
Variable GNUPG_HOMEDIR, but this is not elegant.

Fix

Expand ~ in ~/.gnupg like the csh does it - use getpwnam().

Event Timeline

I will look at this for a future version. In the meantime,
note that if you set the environment variable HOME, tilde
expansion will work properly.

Fixed for 1.4.3.