diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-09-01 16:16:39 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-10-11 13:56:22 +0200 |
commit | ed646dc595b2ee5248b0994a2b44a7a5a7bfbbd5 (patch) | |
tree | 8dba8640b8ebc980c0cf94aa8120a70cd64f5f26 /configmgr | |
parent | 9c9f184138dd9e3dbd50d5d50fc86ca172ae4dfe (diff) |
profilesafe: Initial creation of BackupFileHelper
Added helper class to allow easy creation/deployment
of backups of a file (here: registrymodifications). It
works like a 'stack' of backups, supports easy push/pop
of backed-up versions.
Change-Id: Ie19e1209534f23a3dbd6106a5ca13b24b8fefe4d
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/source/components.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 4797a6732136..f7c473c53899 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -49,6 +49,7 @@ #include <sal/log.hxx> #include <sal/types.h> #include <salhelper/thread.hxx> +#include <comphelper/backupfilehelper.hxx> #include "additions.hxx" #include "components.hxx" @@ -616,6 +617,22 @@ Components::~Components() for (WeakRootSet::iterator i(roots_.begin()); i != roots_.end(); ++i) { (*i)->setAlive(false); } + + // test backup of registrymodifications (currently off) + static bool bFeatureSecureUserConfig(false); + + if (bFeatureSecureUserConfig && ModificationTarget::File == modificationTarget_ && !modificationFileUrl_.isEmpty()) + { + static sal_uInt16 nNumCopies(5); + comphelper::BackupFileHelper aBackupFileHelper(modificationFileUrl_, nNumCopies); + aBackupFileHelper.tryPush(); + static bool bTryPop(false); + + if (bTryPop) + { + aBackupFileHelper.tryPop(); + } + } } void Components::parseFileLeniently( |