diff options
Diffstat (limited to 'src/Main/TextUserInterface.cpp')
-rw-r--r-- | src/Main/TextUserInterface.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp index bc3f6f5a..5dd778a0 100644 --- a/src/Main/TextUserInterface.cpp +++ b/src/Main/TextUserInterface.cpp @@ -1335,6 +1335,18 @@ namespace VeraCrypt return volume; } + // check if the volume path exists using stat function. Only ENOENT error is handled to exclude permission denied error + struct stat statBuf; + if (stat (string (*options.Path).c_str(), &statBuf) != 0) + { + if (errno == ENOENT) + { + SystemException ex (SRC_POS); + ShowError (ex); + return volume; + } + } + // Mount point if (!options.MountPoint && !options.NoFilesystem) options.MountPoint.reset (new DirectoryPath (AskString (_("Enter mount directory [default]: ")))); |