fix setting of opts in FSConfigPtr. Fixes #74 and #75

git-svn-id: http://encfs.googlecode.com/svn/trunk@61 db9cf616-1c43-0410-9cb8-a902689de0d6
This commit is contained in:
Valient Gough 2010-09-05 21:07:26 +00:00
parent 4bb4049d9e
commit 832d3da98b
2 changed files with 15 additions and 14 deletions

View File

@ -970,12 +970,17 @@ bool selectZeroBlockPassThrough()
"This avoids writing encrypted blocks when file holes are created."));
}
RootPtr createV6Config( EncFS_Context *ctx, const std::string &rootDir,
bool enableIdleTracking, bool forceDecode,
const std::string &passwordProgram,
bool useStdin, bool reverseEncryption,
ConfigMode configMode)
RootPtr createV6Config( EncFS_Context *ctx,
const shared_ptr<EncFS_Opts> &opts )
{
const std::string rootDir = opts->rootDir;
bool enableIdleTracking = opts->idleTracking;
bool forceDecode = opts->forceDecode;
const std::string passwordProgram = opts->passwordProgram;
bool useStdin = opts->useStdin;
bool reverseEncryption = opts->reverseEncryption;
ConfigMode configMode = opts->configMode;
RootPtr rootInfo;
// creating new volume key.. should check that is what the user is
@ -1222,6 +1227,7 @@ RootPtr createV6Config( EncFS_Context *ctx, const std::string &rootDir,
fsConfig->forceDecode = forceDecode;
fsConfig->reverseEncryption = reverseEncryption;
fsConfig->idleTracking = enableIdleTracking;
fsConfig->opts = opts;
rootInfo = RootPtr( new EncFS_Root );
rootInfo->cipher = cipher;
@ -1663,6 +1669,7 @@ RootPtr initFS( EncFS_Context *ctx, const shared_ptr<EncFS_Opts> &opts )
fsConfig->config = config;
fsConfig->forceDecode = opts->forceDecode;
fsConfig->reverseEncryption = opts->forceDecode;
fsConfig->opts = opts;
rootInfo = RootPtr( new EncFS_Root );
rootInfo->cipher = cipher;
@ -1674,9 +1681,7 @@ RootPtr initFS( EncFS_Context *ctx, const shared_ptr<EncFS_Opts> &opts )
if(opts->createIfNotFound)
{
// creating a new encrypted filesystem
rootInfo = createV6Config( ctx, opts->rootDir, opts->idleTracking,
opts->forceDecode, opts->passwordProgram, opts->useStdin,
opts->reverseEncryption, opts->configMode );
rootInfo = createV6Config( ctx, opts );
}
}

View File

@ -110,12 +110,8 @@ class EncFS_Context;
RootPtr initFS( EncFS_Context *ctx, const boost::shared_ptr<EncFS_Opts> &opts );
RootPtr createV6Config( EncFS_Context *ctx, const std::string &rootDir,
bool enableIdleTracking,
bool forceDecode,
const std::string &passwordProgram, bool reverseEncryption,
bool allowHoles, ConfigMode mode );
RootPtr createV6Config( EncFS_Context *ctx,
const boost::shared_ptr<EncFS_Opts> &opts );
void showFSInfo( const boost::shared_ptr<EncFSConfig> &config );