[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24076: [PATCH] gnu: GnuPG: Really use ~/.guix-profile/bin/pinentry b
From: |
Ludovic Courtès |
Subject: |
bug#24076: [PATCH] gnu: GnuPG: Really use ~/.guix-profile/bin/pinentry by default. |
Date: |
Sun, 29 Mar 2020 16:57:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hi Leo!
Leo Famulari <address@hidden> skribis:
> This is a followup to commit c7af9d0b5ebaa1fdb08ff5d8a56004998bcd8103.
>
> This patch does as expected for me! But it's been some years since I
> wrote C code, so I copy existing functions and fought through compiler
> errors to write this — please give a close review.
>
> * gnu/packages/patches/gnupg-default-pinentry.patch: Use $HOME to find
> the user's Guix profile and installed pinentry.
Thanks for fixing it, and apologies for the mistake!
> ++/* Return the user's home directory */
> ++const char *
> ++user_homedir (void)
> ++{
> ++ const char *dir;
> ++ dir = getenv("HOME");
Here I’d add:
if (dir == NULL)
{
struct password *pw;
pw = getpwuid (getuid ());
if (pw != NULL)
dir = pw->pw_dir;
else
dir = "/";
}
Otherwise LGTM!
Ludo’.