Page MenuHome GnuPG

gpg should exit with appropriate error if GNUPGHOME directory has bad permissions
Closed, ResolvedPublic

Description

When GNUPGHOME has the permissions 755, gpg --gen-key runs through all the steps
of creating a new key, however, no key is created and no error messages are output.

It would be better if gpg immediately exited with a clear error message if
GNUPGHOME has bad permissions.

Event Timeline

I can see that:

$ ls -la
drwxr-xr-x 2 wk wk 4096 May 8 10:20 .
drwxr-xr-x 8 wk wk 20480 May 8 10:20 ..
$ GNUPGHOME=pwd gpg --gen-key
gpg: WARNING: unsafe permissions on homedir `[....]/x1'
[...]
$ ls -la
drwxr-xr-x 2 wk wk 4096 May 8 10:21 .
drwxr-xr-x 8 wk wk 20480 May 8 10:20 ..
-rw------- 1 wk wk 538 May 8 10:21 pubring.gpg
-rw------- 1 wk wk 538 May 8 10:21 pubring.gpg~
-rw------- 1 wk wk 600 May 8 10:21 random_seed
-rw------- 1 wk wk 563 May 8 10:21 secring.gpg
-rw------- 1 wk wk 1280 May 8 10:21 trustdb.gpg
$ gpg --version
gpg (GnuPG) 1.4.9

werner claimed this task.
werner added a project: Won't Fix.