[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: KDE 3.3: gpg-agent broken, can't sign emails. How to fix?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On August 15, 2004 04:17 pm, Doug Holland wrote:
> I tried the "silly patch" mentioned in 265795 and kdm decided to log
> me in to GNOME instead of KDE, even though I had KDE selected.
>
> I think we're getting warmer - I do indeed have
> a /etc/X11/Xsession/90newpg_gpg-agent file.

Well if you can tell me how to get the variable GPG_AGENT_INFO exported 
properly were both good to go. I took the file you mentioned and copied 
it to /home/user/.gpg-agent-start put the #!/bin/bash as the first line 
then used chmod+x /home/user/.gpg-agent-start on it and added this to 
my .bash_profile.

if [ -f ~/.gpg-agent-start ]; then
    ./.gpg-agent-start
fi

Then the agent will start and the correct information gets put into 
the .gpg-agent-info file that is used. This is code that I used for 
the .gpg-agent-start file I created.

#!/bin/bash
## Added by me for gpg-agent startup

STARTGPG=yes
GPGAGENT=/usr/bin/gpg-agent
GPGAGENTARGS="--daemon"
#GPGAGENTARGS="--daemon --debug-all"

if grep -qs ^use-gpg-agent "$OPTIONFILE"; then
  if [ -x "$GPGAGENT" ]; then
    STARTGPG=yes
  fi
fi

if [ -n "$STARTGPG" ]; then
  if test -f $HOME/.gpg-agent-info && \
     kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then
    GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`
    export GPG_AGENT_INFO
  else
    eval `gpg-agent --daemon`
    echo $GPG_AGENT_INFO >$HOME/.gpg-agent-info
    # Added by me
    export GPG_AGENT_INFO
  fi
fi
#AGENT_FILE='cut -d: -f 1   $HOME/.gpg-agent-info'
#AGENT_PID='cut -d: -f 2   $HOME/.gpg-agent-info'
#GPG_AGENT_INFO=$AGENT_FILE:$AGENT_PID:1
GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`
export GPG_AGENT_INFO


As you can see I tried a couple of ways to get it going but none will 
give me the agent being exported properly although i can get the 
information in a console window.

>$ echo $GPG_AGENT_INFO

>$ cut -d: -f 1   $HOME/.gpg-agent-info
/tmp/gpg-bIHaXm/S.gpg-agent
>$ cut -d: -f 2   $HOME/.gpg-agent-info
642

>$ GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`
>$ echo $GPG_AGENT_INFO
/tmp/gpg-bIHaXm/S.gpg-agent:642:1

And the agent does get started.
>$ ps xa | grep agent
  642 ?        Ss     0:00 /usr/bin/gpg-agent.real --daemon
 1170 pts/5    S+     0:00 grep agent

So if anyone can tell me what is wrong with the script then it should 
work.

And strangely enough when I went to send this message it asked for my 
passphrase so I thought I would save it as a draft and the signing 
works but you have to enter the passphrase every time (I sent myself a 
couple of test messages) I don't remember it being like that before. So 
apparently it is only Kgpg that complains about the agent not being 
started and you can disable that in its configuration and never have to 
see that message when you login.



Stephen





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBH/ByjgQLPii62a8RAk/CAKDviYZZIn/x9XaNYVwywdUuHKI6awCdHRd9
xfzlp1fQILVly28mLGwSQ5Y=
=UwJn
-----END PGP SIGNATURE-----



Reply to: