Skip to content

Please consider POSIXifying the GNUPGHOME variable #297

Open
@chawyehsu

Description

@chawyehsu

Context

GNUPGHOME is an environment variable used by gnupg, which allows users to change the home directory of gpg. gnupg for Windows is an official build that supports changing the home directory using GNUPGHOME in the form of C:\Users\user\.gnupg. In the community however, some tools such as git-for-windows, package a gnupg build based on MSYS2 and rely on the msys2-runtime and only supports parsing and using GNUPGHOME in the form of /c/Users/user/.gnupg to change the home directory.

Why

Under certain conditions, users may actively or passively install multiple editions of gnupg, including the two different gnupg mentioned above. When they want to share the same gnupg home directory across different gnupg builds, they may use the GNUPGHOME variable. However, due to different interpretations of the GNUPGHOME variable, this goal cannot be achieved. This has been discussed in the gnupg mailing list [1][2], and similar issues have also been reported in the git-for-windows issue tracker [3][4]. Specifically, when users set GNUPGHOME=C:\Users\user\.gnupg or GNUPGHOME=C:/Users/user/.gnupg, the gnupg based on msys2-runtime will be unable to use this variable and will report an error.

$ gpgconf.exe -L
sysconfdir:/etc/gnupg
bindir:/usr/bin
libexecdir:/usr/lib/gnupg
libdir:/usr/lib/gnupg
datadir:/usr/share/gnupg
localedir:/usr/share/locale
socketdir:C%3a\Users\user\.gnupg
dirmngr-socket:C%3a\Users\user\.gnupg/S.dirmngr
keyboxd-socket:C%3a\Users\user\.gnupg/S.keyboxd
agent-ssh-socket:C%3a\Users\user\.gnupg/S.gpg-agent.ssh
agent-extra-socket:C%3a\Users\user\.gnupg/S.gpg-agent.extra
agent-browser-socket:C%3a\Users\user\.gnupg/S.gpg-agent.browser
agent-socket:C%3a\Users\user\.gnupg/S.gpg-agent
homedir:C%3a\Users\user\.gnupg

Proposal

Propose to POSIXify the GNUPGHOME variable, similar to the way of handling SHELL implemented by @dscho in [5]. Such a proposal was also mentioned in the comments [6]. I can draft a pull-request or patch if this is reasonable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions