From 2c541474b5c1dddf8a3289349dfcfdf3c15ea686 Mon Sep 17 00:00:00 2001 From: jhepp Date: Sat, 4 Jun 2016 19:12:21 +0200 Subject: [PATCH] Allow writing when loading a reverse mount config - set readOnly to false when uniqueIV is false --- encfs/FileUtils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/encfs/FileUtils.cpp b/encfs/FileUtils.cpp index 7497272..27eef6e 100644 --- a/encfs/FileUtils.cpp +++ b/encfs/FileUtils.cpp @@ -1542,6 +1542,11 @@ RootPtr initFS(EncFS_Context *ctx, const std::shared_ptr &opts) { "The configuration loaded is not compatible with --reverse\n"); return rootInfo; } + /* Reverse mounts are read-only by default (set in main.cpp). + * If uniqueIV is off, writing can be allowed, because there + * is no header that could be overwritten */ + if (config->uniqueIV == false) + opts->readOnly = false; } // first, instanciate the cipher.