3 # Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved.
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 as published
7 # by the Free Software Foundation.
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # You should have received a copy of the GNU General Public License along
15 # with this program; if not, write to the Free Software Foundation, Inc.,
16 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300
19 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
25 eval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
26 & eval 'exec /usr/bin/perl -S $0 $argv:q'
31 my $AMANDA='@CLIENT_LOGIN@';
33 my $ddebug = 1; # set to 1 to print signal debug to stderr
44 $AMANDA_HOME = (getpwnam($AMANDA) )[7] || die "Cannot find $AMANDA home directory\n" ;
45 $AM_PASS = "$AMANDA_HOME/.am_passphrase";
47 unless ( -e $AM_PASS ) {
48 die "secret key $AM_PASS not found\n";
52 $ENV{'PATH'} = '/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/opt/csw/bin';
54 $ENV{'GNUPGHOME'} = "$AMANDA_HOME/.gnupg";
58 system "gpg --batch --no-secmem-warning --disable-mdc --symmetric --cipher-algo AES256 --passphrase-fd 3 3<$AM_PASS";
62 system "gpg --batch --quiet --no-mdc-warning --decrypt --passphrase-fd 3 3<$AM_PASS";
99 $SIG{'INT'} = 'int_catcher';
100 $SIG{'PIPE'} = 'pipe_catcher';
101 $SIG{'HUP'} = 'hup_catcher';
102 $SIG{'ILL'} = 'ill_catcher';
103 $SIG{'TERM'} = 'term_catcher';
104 $SIG{'SEGV'} = 'segv_catcher';
105 $SIG{'QUIT'} = 'quit_catcher';
106 $SIG{'FPE'} = 'FPE_catcher';
110 die "Usage: $0 [-d]\n";
113 if ( $#ARGV==0 && $ARGV[0] eq "-d" ) {
121 if ( $sigint_seen ) { print STDERR "strange sigint seen = $sigint_seen\n"; }
122 if ( $sigpipe_seen ) { print STDERR "strange sigpipe seen = $sigpipe_seen\n"; }
123 if ( $sighup_seen ) { print STDERR "strange sighup seen = $sighup_seen\n"; }
124 if ( $sigill_seen ) { print STDERR "strange sigill seen = $sigill_seen\n"; }
126 if ( $sigterm_seen ) { print STDERR "strange sigterm seen = $sigterm_seen\n"; }
127 if ( $sigsegv_seen ) { print STDERR "strange sigsegv seen = $sigsegv_seen\n"; }
128 if ( $sigquit_seen ) { print STDERR "strange sigquit seen = $sigquit_seen\n"; }
129 if ( $sigfpe_seen ) { print STDERR "strange sigfpe seen = $sigfpe_seen\n"; }
133 $SIG{'INT'} = 'DEFAULT';
134 $SIG{'PIPE'} = 'DEFAULT';
135 $SIG{'HUP'} = 'DEFAULT';
136 $SIG{'ILL'} = 'DEFAULT';
137 $SIG{'TERM'} = 'DEFAULT';
138 $SIG{'SEGV'} = 'DEFAULT';
139 $SIG{'QUIT'} = 'DEFAULT';
140 $SIG{'FPE'} = 'DEFAULT';