diff --git a/ChangeLog.txt b/ChangeLog.txt index d2ff7e0d..6333f433 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +Version 0.11.5 (unreleased) +--------------- +* Fix an issue when using `-o` atime mount options + Version 0.11.4 --------------- * Fixed build issue with GCC 13 (see https://github.com/cryfs/cryfs/pull/448 ) diff --git a/src/fspp/fuse/Fuse.cpp b/src/fspp/fuse/Fuse.cpp index 4b881815..7455db8e 100644 --- a/src/fspp/fuse/Fuse.cpp +++ b/src/fspp/fuse/Fuse.cpp @@ -338,12 +338,24 @@ void extractAllAtimeOptionsAndRemoveOnesUnknownToLibfuse_(string* csv_options, v vector extractAllAtimeOptionsAndRemoveOnesUnknownToLibfuse_(vector* fuseOptions) { vector result; bool lastOptionWasDashO = false; - for (string& option : *fuseOptions) { - if (lastOptionWasDashO) { - extractAllAtimeOptionsAndRemoveOnesUnknownToLibfuse_(&option, &result); + for (size_t i = 0; i < fuseOptions->size(); ++i) + { + string &option = (*fuseOptions)[i]; + if (lastOptionWasDashO) + { + extractAllAtimeOptionsAndRemoveOnesUnknownToLibfuse_(&option, &result); + if (option.empty()) { + // All options were removed, remove the empty argument + fuseOptions->erase(fuseOptions->begin() + i); + --i; + // And also remove the now value-less '-o' before it + fuseOptions->erase(fuseOptions->begin() + i); + --i; } - lastOptionWasDashO = (option == "-o"); + } + lastOptionWasDashO = (option == "-o"); } + return result; } }