In 2.0.26 this works as expected - the passphrase is accepted from STDIN during
scripts:
echo XXXX | /usr/bin/gpg --sign --default-key 15DE5E40 --passphrase-fd 0 --batch
-r 15DE5E40 -o /tmp/duply.5459.1416887390_ENC -e /usr/bin/duply
According to the 2.1.x docs, 'echo FOO | gpg --passphrase-fd 0' is still
supported, however it appears to ignore STDIN and always forces pinentry from
gpg-agent which I think is a bug. (note: I have no special
gpg.conf/gpg-agent.conf settings - vanilla setup)
I also created a full package (Arch) for 2.1.1-beta44 from git (make distcheck)
to test; I validated this bug by grabbing pinentry.sh from tests/openpgp/ and
making that my pinentry program in ~/.gnupg/gpg-agent.conf - by editing
pinentry.sh and hard-encoding the passphrase it "works" (in that this suffices
for pinentry), however everything from STDIN is still ignored. I can play with
the passphrases to ensure that it's broken; however once it's added correctly to
gpg-agent the process works as expected.
Compile options:
./configure --prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin
--libexecdir=/usr/lib/gnupg --enable-maintainer-mode --enable-symcryptrun
--enable-gpgtar
The expectation is that the 'echo FOO | gpg --passphrase-fd 0' works without
gpg-agent and/or pinentry popping up (for use in scripts) as it does in 2.0.26.
I noticed that in 2.0.26 the gpg-agent was *not* launched and left running in
the background, however on 2.1.0/2.1.1-beta44 it's launched/stays running. This
may just be changed behaviour though and expected.