solve issue number 24

This commit is contained in:
Francis Banyikwa 2016-06-01 13:37:44 +03:00
parent 2cf4a2e087
commit 002dc6ca17

View File

@ -16,6 +16,20 @@ ProgramOptions::ProgramOptions(const bf::path &baseDir, const bf::path &mountDir
:_baseDir(baseDir), _mountDir(mountDir), _configFile(configFile), _foreground(foreground),
_cipher(cipher), _blocksizeBytes(blocksizeBytes), _unmountAfterIdleMinutes(unmountAfterIdleMinutes),
_logFile(logFile), _fuseOptions(fuseOptions) {
auto hasNoOption = [&](const char *opt) {
for (const string& it : _fuseOptions) {
if (std::strncmp(it.c_str(), opt, std::strlen(opt))) {
return false;
}
}
return true;
};
if (hasNoOption("subtype=cryfs") && hasNoOption("fsname=cryfs@")) {
_fuseOptions.push_back("-ofsname=cryfs@"+baseDir.native());
_fuseOptions.push_back("-osubtype=cryfs");
}
}
const bf::path &ProgramOptions::baseDir() const {