can't get passphrase-fd option to work with GnuPG on HPUX when running a scheduled batch

Steve Butler sbutler@fchn.com
Tue Aug 13 20:23:01 2002


Try the --batch keyword.  Here is the script I use for decrypting files
inbound to our site:

#!/bin/ksh
# COPYRIGHT (c) 1995-2002 Stephen M. Butler dba XRG
# This information may be copied, distributed and/or modified under
# certain conditions, but it comes WITHOUT ANY WARRANTY.
# See the Design Science License for more details
# =================================================================
#
#  gpg_decrypt pass_id   input_file  output_file
#     Interface for edi and default routines to decrypt pgp files vi GnuPG.
#     
#     pass_id      1 or 2 to indicate which pass phrase needs to be picked
up.
#     input_file   name of file to decrypt.  Includes any path
#     output_file  name where to place output plain text file (with path)
#
#     Note:  See 'default' script for default usage.

homedir=$(default gpg_home)

  rm -f "$3" 2>&1 1> /dev/null
  default gpg_pass$1 \
  | gpg --homedir $homedir --passphrase-fd 0 --no-tty --skip-verify \
        --output "$3" --decrypt "$2"
#

Note that our option file includes:
batch

-----Original Message-----
From: poney [mailto:rpc123@promtech.com]
Sent: Tuesday, August 13, 2002 9:43 AM
To: gnupg-users@gnupg.org
Subject: can't get passphrase-fd option to work with GnuPG on HPUX when
running a scheduled batch


Hi, I'm new to the list. Sorry to join just when I need help with a problem,

but goes.

We're trying to use the --passphrase-fd option with GnuPG from a shell
script 
running through a batch run by scheduling software (ESP) on HPUX11.0 (not a 
good idea, I know, but it's what we need). We're using gpg version 1.0.7. 
Even though we can get the script to work when run interactively, regardless

of how we use the option (using standard in or with a real file descriptor),

the gpg command is failing when run through the scheduling software with the

following error:

gpp: cannot open /dev/tty: No such device or address

I was assuming this had something to do with the process running the script 
not having access to standard in in the same way that the script has when we

run it interactively. I've had the scheduling software su to the correct
user 
to help set the environment correctly, but it still doesn't work. I'm
looking 
for suggestions with trouble-shooting the problem.

Not sure if it's related, but I've never been able to successfuly use a real

file descriptor with the --passphrase-fd option on this platform. This works

in a shell script:

gpg --passphrase-fd 0 --decrypt myfile.txt.pgp <<!
mypassphrase
!

But this just prompts me for the passphrase:

gpg --passphrase-fd secretinfo.txt --decrypt myfile.txt.pgp

I've specified the path to the file in a number of ways, to try to ensure it

can find the file, but it still won't work. I've also tried using the option

in with a number of other options (--output, --yes, etc) since I've noticed 
that using some options together seems to change the behavior of the gpg 
command in unexpexted ways, but I still can't make it work. 

Any thoughts on what could be causing the problem, or suggestions about how 
to get around it?

Poney Carpenter

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


CONFIDENTIALITY NOTICE:  This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.