projects
/
debian
/
amanda
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 3.3.1
[debian/amanda]
/
common-src
/
amcryptsimple.pl
diff --git
a/common-src/amcryptsimple.pl
b/common-src/amcryptsimple.pl
index cf5306bf2b3698fc7784246c7005892bc9d049ae..e8d492280dcb037ca5477cc15a237d7661b32575 100755
(executable)
--- a/
common-src/amcryptsimple.pl
+++ b/
common-src/amcryptsimple.pl
@@
-53,9
+53,18
@@
$ENV{'PATH'} = '/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/opt/csw/bin';
$ENV{'GNUPGHOME'} = "$AMANDA_HOME/.gnupg";
$ENV{'GNUPGHOME'} = "$AMANDA_HOME/.gnupg";
+sub do_gpg_agent() {
+ my $path=`which gpg-agent 2>/dev/null`;
+ chomp $path;
+ if (-x $path) {
+ return "gpg-agent --daemon --";
+ }
+ return ""
+}
sub encrypt() {
sub encrypt() {
- system "gpg --batch --no-secmem-warning --disable-mdc --symmetric --cipher-algo AES256 --passphrase-fd 3 3<$AM_PASS";
+ my $gpg_agent_cmd = do_gpg_agent();
+ system "$gpg_agent_cmd gpg --batch --no-secmem-warning --disable-mdc --symmetric --cipher-algo AES256 --passphrase-fd 3 3<$AM_PASS";
if ($? == -1) {
print STDERR "failed to execute gpg: $!\n";
exit (1);
if ($? == -1) {
print STDERR "failed to execute gpg: $!\n";
exit (1);
@@
-69,7
+78,8
@@
sub encrypt() {
}
sub decrypt() {
}
sub decrypt() {
- system "gpg --batch --quiet --no-mdc-warning --decrypt --passphrase-fd 3 3<$AM_PASS";
+ my $gpg_agent_cmd = do_gpg_agent();
+ system "$gpg_agent_cmd gpg --batch --quiet --no-mdc-warning --decrypt --passphrase-fd 3 3<$AM_PASS";
if ($? == -1) {
print STDERR "failed to execute gpg: $!\n";
exit (1);
if ($? == -1) {
print STDERR "failed to execute gpg: $!\n";
exit (1);