From ff0872f12968a00ea2e3d2b95c54f97d98b51585 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Fri, 17 Aug 2007 12:38:03 -0700 Subject: [PATCH] lbs-util now supports reading encrypted segments (with lbs-filter-gpg). 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 | 4 ++-- lbs-util | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/LBS.pm b/LBS.pm index 9300c3f..372a673 100644 --- 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} = [ ]; diff --git a/lbs-util b/lbs-util index 37f5e9f..5a5ebf6 100755 --- a/lbs-util +++ b/lbs-util @@ -7,9 +7,16 @@ # Available commands: # --list-snapshots # --list-segments +# --verify-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"; -- 2.20.1