lbs-util now supports reading encrypted segments (with lbs-filter-gpg).
authorMichael Vrable <mvrable@cs.ucsd.edu>
Fri, 17 Aug 2007 19:38:03 +0000 (12:38 -0700)
committerMichael Vrable <mvrable@turin.ucsd.edu>
Fri, 17 Aug 2007 19:38:03 +0000 (12:38 -0700)
Change the default to encrypted segments rather than compressed with bzip2.
The default of the lbs program has not been changed; it is still necessary
to specify the correct options there to generate encrypted backups.

LBS.pm
lbs-util

diff --git a/LBS.pm b/LBS.pm
index 9300c3f..372a673 100644 (file)
--- a/LBS.pm
+++ b/LBS.pm
@@ -124,8 +124,8 @@ automatically validate any object checksums.
 
         print STDERR "### Tempdir is $self->{TMPDIR}\n";
 
-        $self->{EXTENSION} = ".bz2";
-        $self->{FILTER} = "bzip2 -dc";
+        $self->{EXTENSION} = ".gpg";
+        $self->{FILTER} = "lbs-filter-gpg --decrypt";
 
         $self->{CACHED} = [ ];
 
index 37f5e9f..5a5ebf6 100755 (executable)
--- a/lbs-util
+++ b/lbs-util
@@ -7,9 +7,16 @@
 # Available commands:
 #   --list-snapshots
 #   --list-segments
+#   --verify-snapshot <snapshot>
 
 use strict;
 use LBS qw(parse_headers);
+use Term::ReadPassword;
+
+sub get_password {
+    return if exists $ENV{LBS_GPG_PASSPHRASE};
+    $ENV{LBS_GPG_PASSPHRASE} = read_password('Passphrase: ');
+}
 
 die "Too few arguments!\n" unless scalar(@ARGV) >= 2;
 die "Must specify a repository!\n" unless -d $ARGV[0];
@@ -27,6 +34,8 @@ if ($cmd eq "--list-snapshots") {
         print $_, "\n";
     }
 } elsif ($cmd eq "--verify-snapshot") {
+    get_password();
+
     my $snapshot = $store->load_snapshot($args[0]);
     my %info = parse_headers($snapshot);
     print "Root: $info{Root}\n";