mirror of
https://github.com/vgough/encfs.git
synced 2025-01-16 19:08:46 +01:00
add delaymount option which delays initial mount. Patch by Jeff King
git-svn-id: http://encfs.googlecode.com/svn/trunk@115 db9cf616-1c43-0410-9cb8-a902689de0d6
This commit is contained in:
parent
0b6fabffde
commit
e2b912c731
@ -10,7 +10,7 @@ B<encfs> [B<--version>] [B<-s>] [B<-f>] [B<-v>|B<--verbose>]
|
|||||||
[B<-i MINUTES>|B<--idle=MINUTES>] [B<--extpass=program>]
|
[B<-i MINUTES>|B<--idle=MINUTES>] [B<--extpass=program>]
|
||||||
[B<-S>|B<--stdinpass>] [B<--anykey>] [B<--forcedecode>]
|
[B<-S>|B<--stdinpass>] [B<--anykey>] [B<--forcedecode>]
|
||||||
[B<-d>|B<--fuse-debug>] [B<--public>] [B<--no-default-flags>]
|
[B<-d>|B<--fuse-debug>] [B<--public>] [B<--no-default-flags>]
|
||||||
[B<--ondemand>] [B<--reverse>] [B<--standard>]
|
[B<--ondemand>] [B<--delaymount>] [B<--reverse>] [B<--standard>]
|
||||||
[B<-o FUSE_OPTION>]
|
[B<-o FUSE_OPTION>]
|
||||||
I<rootdir> I<mountPoint>
|
I<rootdir> I<mountPoint>
|
||||||
[B<--> [I<Fuse Mount Options>]]
|
[B<--> [I<Fuse Mount Options>]]
|
||||||
@ -106,6 +106,11 @@ internally dropping its reference to it. If someone attempts to access the
|
|||||||
filesystem again, the extpass program is used to prompt the user for the
|
filesystem again, the extpass program is used to prompt the user for the
|
||||||
password. If this succeeds, then the filesystem becomes available again.
|
password. If this succeeds, then the filesystem becomes available again.
|
||||||
|
|
||||||
|
=item B<--delaymount>
|
||||||
|
|
||||||
|
Do not mount the filesystem when encfs starts; instead, delay mounting until
|
||||||
|
first use. This option only makes sense with B<--ondemand>.
|
||||||
|
|
||||||
=item B<--reverse>
|
=item B<--reverse>
|
||||||
|
|
||||||
Normally B<EncFS> provides a plaintext view of data on demand. Normally it
|
Normally B<EncFS> provides a plaintext view of data on demand. Normally it
|
||||||
|
@ -102,6 +102,7 @@ struct EncFS_Args
|
|||||||
if(opts->annotate) ss << "(annotate) ";
|
if(opts->annotate) ss << "(annotate) ";
|
||||||
if(opts->reverseEncryption) ss << "(reverseEncryption) ";
|
if(opts->reverseEncryption) ss << "(reverseEncryption) ";
|
||||||
if(opts->mountOnDemand) ss << "(mountOnDemand) ";
|
if(opts->mountOnDemand) ss << "(mountOnDemand) ";
|
||||||
|
if(opts->delayMount) ss << "(delayMount) ";
|
||||||
for(int i=0; i<fuseArgc; ++i)
|
for(int i=0; i<fuseArgc; ++i)
|
||||||
ss << fuseArgv[i] << ' ';
|
ss << fuseArgv[i] << ' ';
|
||||||
|
|
||||||
@ -219,6 +220,7 @@ bool processArgs(int argc, char *argv[], const shared_ptr<EncFS_Args> &out)
|
|||||||
{"anykey", 0, 0, 'k'}, // skip key checks
|
{"anykey", 0, 0, 'k'}, // skip key checks
|
||||||
{"no-default-flags", 0, 0, 'N'}, // don't use default fuse flags
|
{"no-default-flags", 0, 0, 'N'}, // don't use default fuse flags
|
||||||
{"ondemand", 0, 0, 'm'}, // mount on-demand
|
{"ondemand", 0, 0, 'm'}, // mount on-demand
|
||||||
|
{"delaymount", 0, 0, 'M'}, // delay initial mount until use
|
||||||
{"public", 0, 0, 'P'}, // public mode
|
{"public", 0, 0, 'P'}, // public mode
|
||||||
{"extpass", 1, 0, 'p'}, // external password program
|
{"extpass", 1, 0, 'p'}, // external password program
|
||||||
// {"single-thread", 0, 0, 's'}, // single-threaded mode
|
// {"single-thread", 0, 0, 's'}, // single-threaded mode
|
||||||
@ -294,6 +296,9 @@ bool processArgs(int argc, char *argv[], const shared_ptr<EncFS_Args> &out)
|
|||||||
case 'm':
|
case 'm':
|
||||||
out->opts->mountOnDemand = true;
|
out->opts->mountOnDemand = true;
|
||||||
break;
|
break;
|
||||||
|
case 'M':
|
||||||
|
out->opts->delayMount = true;
|
||||||
|
break;
|
||||||
case 'N':
|
case 'N':
|
||||||
useDefaultFlags = false;
|
useDefaultFlags = false;
|
||||||
break;
|
break;
|
||||||
@ -404,6 +409,15 @@ bool processArgs(int argc, char *argv[], const shared_ptr<EncFS_Args> &out)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(out->opts->delayMount && !out->opts->mountOnDemand)
|
||||||
|
{
|
||||||
|
cerr <<
|
||||||
|
// xgroup(usage)
|
||||||
|
_("You must use mount-on-demand with delay-mount")
|
||||||
|
<< endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(out->opts->mountOnDemand && out->opts->passwordProgram.empty())
|
if(out->opts->mountOnDemand && out->opts->passwordProgram.empty())
|
||||||
{
|
{
|
||||||
cerr <<
|
cerr <<
|
||||||
@ -594,6 +608,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if( rootInfo )
|
if( rootInfo )
|
||||||
{
|
{
|
||||||
|
// turn off delayMount, as our prior call to initFS has already
|
||||||
|
// respected any delay, and we want future calls to actually mount.
|
||||||
|
encfsArgs->opts->delayMount = false;
|
||||||
|
|
||||||
// set the globally visible root directory node
|
// set the globally visible root directory node
|
||||||
ctx->setRoot( rootInfo->root );
|
ctx->setRoot( rootInfo->root );
|
||||||
ctx->args = encfsArgs;
|
ctx->args = encfsArgs;
|
||||||
|
@ -1609,6 +1609,14 @@ RootPtr initFS( EncFS_Context *ctx, const shared_ptr<EncFS_Opts> &opts )
|
|||||||
return rootInfo;
|
return rootInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(opts->delayMount)
|
||||||
|
{
|
||||||
|
rootInfo = RootPtr( new EncFS_Root );
|
||||||
|
rootInfo->cipher = cipher;
|
||||||
|
rootInfo->root = shared_ptr<DirNode>();
|
||||||
|
return rootInfo;
|
||||||
|
}
|
||||||
|
|
||||||
// get user key
|
// get user key
|
||||||
CipherKey userKey;
|
CipherKey userKey;
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ struct EncFS_Opts
|
|||||||
bool createIfNotFound; // create filesystem if not found
|
bool createIfNotFound; // create filesystem if not found
|
||||||
bool idleTracking; // turn on idle monitoring of filesystem
|
bool idleTracking; // turn on idle monitoring of filesystem
|
||||||
bool mountOnDemand; // mounting on-demand
|
bool mountOnDemand; // mounting on-demand
|
||||||
|
bool delayMount; // delay initial mount
|
||||||
|
|
||||||
bool checkKey; // check crypto key decoding
|
bool checkKey; // check crypto key decoding
|
||||||
bool forceDecode; // force decode on MAC block failures
|
bool forceDecode; // force decode on MAC block failures
|
||||||
@ -91,6 +92,7 @@ struct EncFS_Opts
|
|||||||
createIfNotFound = true;
|
createIfNotFound = true;
|
||||||
idleTracking = false;
|
idleTracking = false;
|
||||||
mountOnDemand = false;
|
mountOnDemand = false;
|
||||||
|
delayMount = false;
|
||||||
checkKey = true;
|
checkKey = true;
|
||||||
forceDecode = false;
|
forceDecode = false;
|
||||||
useStdin = false;
|
useStdin = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user