diff --git a/ChangeLog.txt b/ChangeLog.txt index a5931ad9..e209e264 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -5,7 +5,7 @@ Version 0.9.3 (unreleased) Furthermore, we won't ask for password confirmation when creating a file system but the password only has to be sent once to stdin. * You can disable the automatic update check by setting CRYFS_NO_UPDATE_CHECK=true in your environment. * Building CryFS from the GitHub tarball (i.e. when there is no .git directory present) works. -* The ciphertext block size is configurable. You can use the "--blocksize-bytes" command line argument. If not specified, CryFS will ask you for a block size when creating a file system. +* The ciphertext block size is configurable. You can use the "--blocksize" command line argument. If not specified, CryFS will ask you for a block size when creating a file system. * Fix fstat (a bug in the fstat implementation caused problems with some text editors (e.g. nano) falsely thinking a file changed since they opened it). * Fix rename (when trying to rename a file to an already existing file name, a bug deleted it instead). * Rename operation allows overwriting existing files. diff --git a/src/cryfs-cli/program_options/Parser.cpp b/src/cryfs-cli/program_options/Parser.cpp index 8ca9c994..0ec1931b 100644 --- a/src/cryfs-cli/program_options/Parser.cpp +++ b/src/cryfs-cli/program_options/Parser.cpp @@ -63,8 +63,8 @@ ProgramOptions Parser::parse(const vector &supportedCiphers) const { _checkValidCipher(*cipher, supportedCiphers); } optional blocksizeBytes = none; - if (vm.count("blocksize-bytes")) { - blocksizeBytes = vm["blocksize-bytes"].as(); + if (vm.count("blocksize")) { + blocksizeBytes = vm["blocksize"].as(); } return ProgramOptions(baseDir, mountDir, configfile, foreground, unmountAfterIdleMinutes, logfile, cipher, blocksizeBytes, options.second); @@ -113,7 +113,7 @@ void Parser::_addAllowedOptions(po::options_description *desc) { ("config,c", po::value(), "Configuration file") ("foreground,f", "Run CryFS in foreground.") ("cipher", po::value(), "Cipher to use for encryption. See possible values by calling cryfs with --show-ciphers.") - ("blocksize-bytes", po::value(), "The block size used when storing ciphertext blocks (in bytes).") + ("blocksize", po::value(), "The block size used when storing ciphertext blocks (in bytes).") ("show-ciphers", "Show list of supported ciphers.") ("unmount-idle", po::value(), "Automatically unmount after specified number of idle minutes.") ("logfile", po::value(), "Specify the file to write log messages to. If this is not specified, log messages will go to stdout, or syslog if CryFS is running in the background.") diff --git a/test/cryfs-cli/program_options/ParserTest.cpp b/test/cryfs-cli/program_options/ParserTest.cpp index 0539462b..13ee6ed8 100644 --- a/test/cryfs-cli/program_options/ParserTest.cpp +++ b/test/cryfs-cli/program_options/ParserTest.cpp @@ -107,6 +107,11 @@ TEST_F(ProgramOptionsParserTest, UnmountAfterIdleMinutesGiven_Float) { EXPECT_EQ(0.5, options.unmountAfterIdleMinutes().value()); } +TEST_F(ProgramOptionsParserTest, BlocksizeGiven) { + ProgramOptions options = parse({"./myExecutable", "/home/user/baseDir", "--blocksize", "10240", "/home/user/mountDir"}); + EXPECT_EQ(10240u, options.blocksizeBytes().value()); +} + TEST_F(ProgramOptionsParserTest, InvalidCipher) { EXPECT_DEATH( parse({"./myExecutable", "/home/user/baseDir", "--cipher", "invalid-cipher", "/home/user/mountDir"}),