Respect options on storage initialization

master
Vladimir Stackov 2015-01-23 15:08:02 +03:00
parent aaffa344d2
commit a04128961a
3 changed files with 6 additions and 3 deletions

View File

@ -505,7 +505,8 @@ invalid_option:
return EXIT_FAILURE;
}
ZBackup::initStorage( args[ 1 ], passwords[ 0 ], !passwords[ 0 ].empty() );
ZBackup::initStorage( args[ 1 ],
passwords[ 0 ], !passwords[ 0 ].empty(), config );
}
else
if ( strcmp( args[ 0 ], "backup" ) == 0 )

View File

@ -180,12 +180,14 @@ ExtendedStorageInfo ZBackupBase::loadExtendedStorageInfo(
void ZBackupBase::initStorage( string const & storageDir,
string const & password,
bool isEncrypted )
bool isEncrypted,
Config const & configIn )
{
StorageInfo storageInfo;
ExtendedStorageInfo extendedStorageInfo;
Config config( extendedStorageInfo.mutable_config() );
config.reset_storable();
config.storable->MergeFrom( *configIn.storable );
EncryptionKey encryptionkey = EncryptionKey::noKey();

View File

@ -51,7 +51,7 @@ public:
/// Creates new storage
static void initStorage( std::string const & storageDir, std::string const & password,
bool isEncrypted );
bool isEncrypted, Config const & );
/// For a given file within the backups/ dir in the storage, returns its
/// storage dir or throws an exception