Search code examples
linuxg++truecryptlibfuse

Building TrueCrypt from source on Linux - Error: fuse: bad mount point / invalid characters encountered


When building TrueCrypt 7.1a from source code on Linux, the following errors occur:

  • Error: fuse: bad mount point
  • Error: invalid characters encountered

The following software and versions are used:

  • x86_64 GNU/Linux with kernel 5.16.9
  • g++ (GCC) 11.2.0
  • libfuse-fuse-3.12.0
  • wxWidgets-3.2.1

To comply with libfuse, I have change FuseService.cpp follows:

  • line 50: static void *fuse_service_init (struct fuse_conn_info *conn, struct fuse_config *cfg)
  • line 94: static int fuse_service_getattr (const char *path, struct stat *statData, struct fuse_file_info *fi)
  • line 251: static int fuse_service_readdir (const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi, enum fuse_readdir_flags flags)
  • line 261: filler (buf, ".", NULL, 0, FUSE_FILL_DIR_PLUS);
  • line 262: filler (buf, "..", NULL, 0, FUSE_FILL_DIR_PLUS);
  • line 263: filler (buf, FuseService::GetVolumeImagePath() + 1, NULL, 0, FUSE_FILL_DIR_PLUS);
  • line 264: filler (buf, FuseService::GetControlPath() + 1, NULL, 0, FUSE_FILL_DIR_PLUS);
  • line 582: _exit (fuse_main (argc, argv, &fuse_service_oper, NULL));

How can the errors be resolved?


Solution

  • libfuse is fed with erroneous input data in Process.cpp. The problem is solved by replacing the legacy/internal foreach construct in lines 55-58 with a valid C++ statement:

    for (list<string>::const_iterator it = arguments.begin(); it != arguments.end(); it++)
    {
        args[argIndex++] = const_cast <char*> (it->c_str());
    }