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

Re: Inline PGP signatures [was: Re: email signatures]



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

On Sunday 28 March 2004 12:21 pm, Werner Mahr wrote:
> Am Samstag, 27. März 2004 21:19 schrieb Brad Sims:
> > On Saturday 27 March 2004 6:06 am, Werner Mahr wrote:
> > > Do I need both lines, or is one for Woody and one for Sarge?
> >
> > I /think/ one is for Woody and one is for Sarge, but as I play with
> > Sid... Apt will get the one with the newest version as I understand
> > it <g>
>
> Yes, the line with testing is for testing. Little Question on
> gpg-agent. The docs at
> http://kmail.kde.org/kmail-pgpmime-howto.html#kmail say, that
> gpg-agent can create a shelscript. But this don't work for me. I do:
>
> werner@Werner1:/usr/src$ gpg-agent --sh
> gpg-agent[1060]: Bitte die Option `--daemon' nutzen um das Programm
> im Hintergund auszuführen
> werner@Werner1:/usr/src$
>
> don't work, And I do:
>
> werner@Werner1:/usr/src$ gpg-agent --daemon --options
> ~/.gnupg/gpg-agent.conf --sh
> GPG_AGENT_INFO=/tmp/gpg-mfh4S5/S.gpg-agent:1008:1; export
> GPG_AGENT_INFO; werner@Werner1:/usr/src$
>
> and the agent is startet, but I don't get any Script. How can I let
> gpg-agent start at boot?

The stuff it's spitting out to stdout has to be sourced by your shell. So you can, for instance, run the command in backticks, or output it to a file then source it.

On my machines, I use the following script as /etc/X11/Xsession.d/95gpg-agent-start


GPG_AGENT_INFO_FILE=${HOME}/.gpg-agent-info
GPG_AGENT_CONFIG_DIR=${HOME}/.gnupg
GPG_AGENT_CONFIG_FILE=${GPG_AGENT_CONFIG_DIR}/gpg-agent.conf

if [ -x /usr/bin/gpg-agent ]; then
  if [ -e ${GPG_AGENT_INFO_FILE} ]; then
    OLD_GPG_AGENT=`cat ${GPG_AGENT_INFO_FILE}`
    CHECK_PID=`echo ${OLD_GPG_AGENT}|cut -d ":" -f 2`
    PROG=`ps u ${CHECK_PID} | tail -1 | sed -re 's/^([^ ]+) +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +([^ ]+).*$/\1 \2/'`
    if [ "x${PROG}x" != "x${USER} gpg-agentx" ]; then
      rm -f $GPG_AGENT_INFO_FILE
    else
      export GPG_AGENT_INFO=${OLD_GPG_AGENT}
    fi
  fi
  if [ ! -e ${GPG_AGENT_INFO_FILE} ]; then
    if [ ! -e $GPG_AGENT_CONFIG_DIR ]; then
      mkdir -p $GPG_AGENT_CONFIG_DIR
      chmod 700 $GPG_AGENT_CONFIG_DIR
    fi
    if [ ! -e $GPG_AGENT_CONFIG_FILE ]; then
      touch $GPG_AGENT_CONFIG_FILE
    fi
    eval "$(gpg-agent --daemon --options $GPG_AGENT_CONFIG_FILE)"
    echo $GPG_AGENT_INFO > $GPG_AGENT_INFO_FILE
    chmod 600 $GPG_AGENT_INFO_FILE
  fi
fi

A bit evil, but it works fine for me. =)

- --
Wesley J. Landaker <wjl@icecavern.net>
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2

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

iD8DBQFAZ16R8KmKTEzW49IRApRyAJwNPRlAKgyuQjm6Lk83OXYpHnEEagCeJGxG
mSpDrv848EGhlfxFOR/m4/s=
=tGYM
-----END PGP SIGNATURE-----



Reply to: