dont hard code "cryfs" name in the fspp library

This commit is contained in:
Francis Banyikwa 2016-06-02 11:17:55 +03:00
parent c5a6f16cd5
commit 183d6a9d06
3 changed files with 6 additions and 5 deletions

View File

@ -227,7 +227,7 @@ namespace cryfs {
CryDevice device(std::move(config), std::move(blockStore));
_sanityCheckFilesystem(&device);
fspp::FilesystemImpl fsimpl(&device);
fspp::fuse::Fuse fuse(&fsimpl);
fspp::fuse::Fuse fuse(&fsimpl, "cryfs");
_initLogfile(options);

View File

@ -217,8 +217,8 @@ Fuse::~Fuse() {
_argv.clear();
}
Fuse::Fuse(Filesystem *fs)
:_fs(fs), _mountdir(), _running(false) {
Fuse::Fuse(Filesystem *fs, const std::string &fsname)
:_fs(fs), _mountdir(), _running(false), _fsname(fsname) {
}
void Fuse::_logException(const std::exception &e) {
@ -235,7 +235,7 @@ void Fuse::run(const bf::path &mountdir, const vector<string> &fuseOptions) {
ASSERT(_argv.size() == 0, "Filesystem already started");
_argv.reserve(2 + fuseOptions.size());
_argv.push_back(_create_c_string("cryfs")); // The first argument is the executable name
_argv.push_back(_create_c_string(_fsname)); // The first argument is the file system name
_argv.push_back(_create_c_string(mountdir.native())); // The second argument is the mountdir
for (const string &option : fuseOptions) {
_argv.push_back(_create_c_string(option));

View File

@ -18,7 +18,7 @@ class Filesystem;
class Fuse final {
public:
explicit Fuse(Filesystem *fs);
explicit Fuse(Filesystem *fs, const std::string &fsname);
~Fuse();
void run(const boost::filesystem::path &mountdir, const std::vector<std::string> &fuseOptions);
@ -65,6 +65,7 @@ private:
boost::filesystem::path _mountdir;
std::vector<char*> _argv;
bool _running;
std::string _fsname;
DISALLOW_COPY_AND_ASSIGN(Fuse);
};