Re: thunderbird needs graphical pinentry to use external gnupg for encrypting emails

"Xi Ruoyao" ([email protected] via blfs-dev Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.beyond.devel
Message-ID <[email protected]>
On Wed, 2024-11-20 at 16:23 +0800, Xi Ruoyao wrote:
> On Wed, 2024-11-20 at 01:36 -0600, Bruce Dubbs wrote:
> > On 11/19/24 22:59, Xi Ruoyao ([email protected] via blfs-dev Mailing List) wrote:
> > 
> > > > I do really sign my BLFS commits with GPG but your (and my) posts to
> > > > blfs-dev are not signed.  So I can logically consider the git use case
> > > > more important here (while IMO both Git page and Thunderbird page are a
> > > > wrong location).
> > > 
> > > I've fixed Git with:
> > > 
> > > commit 7c9e274a7ac1a97315bce625af2be40ef7afb1c3
> > > Author: Xi Ruoyao <[email protected]>
> > > Date:   Wed Nov 20 12:57:16 2024 +0800
> > > 
> > >      profile: Set GPG_TTY for GnuPG
> > > 
> > > diff --git a/postlfs/config/profile.xml b/postlfs/config/profile.xml
> > > index 935d9308f9..0c6b058323 100644
> > > --- a/postlfs/config/profile.xml
> > > +++ b/postlfs/config/profile.xml
> > > @@ -175,6 +175,10 @@ export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/share}
> > >   export XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-/etc/xdg}
> > >   export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/tmp/xdg-$USER}
> > >   
> > > +# GnuPG wants this or it'll fail with pinentry-curses under some
> > > +# circumstances (for example signing a Git commit)
> > > +tty -s &amp;&amp; export GPG_TTY=$(tty)
> > > +
> > >   # Set up a red prompt for root and a green one for users.
> > >   NORMAL="\[\e[0m\]"
> > >   RED="\[\e[1;31m\]"
> > > 
> > > But obviously it doesn't help GUI apps.
> > 
> > I'm not sure this is good for /etc/profile when using a terminal emulator in a 
> > graphical desktop environment.  I use konsole with multiple instances and tabs.
> > When creating a new instance or a new tab, /etc/profile is not sourced, only 
> > $HOME/.bashrc.
> 
> Oops I do intend to add it to /etc/bashrc.  But our bashrc and
> bash_profile are too similar so I made the change at a wrong location
> :(.
> 
> But then actually we'll need it in *both* bash_profile and bashrc or it
> won't work in a login shell.  AFAIK most other distros sources bashrc in
> bash_profile.  Should we do the same?
> 
> I'll revert the change for now and do experiments in a new branch.

Oh I just saw we already have

if [ -f "$HOME/.bashrc" ] ; then
  source $HOME/.bashrc
fi

in our .bash_profile.  Thus simply adding the line to /etc/bashrc will
be correct.

P.S. aliasing git is not a good solution, as other things using gpg in a
similar way (hg?) will still fail.


-- 
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University

-- 
http://lists.linuxfromscratch.org/sympa/info/blfs-dev
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.