Clarify read-only handling of reverse mounts without uniqueIV

Also, delete unused define

Both issues spottet by Valient Gough's review
This commit is contained in:
Jakob Unterwurzacher 2014-12-01 20:13:40 +01:00
parent 8b8130782d
commit 8c7cf98af6
2 changed files with 5 additions and 3 deletions

View File

@ -1036,8 +1036,11 @@ RootPtr createV6Config(EncFS_Context *ctx, const shared_ptr<EncFS_Opts> &opts) {
if (reverseEncryption) {
cout << _("reverse encryption - chained IV and MAC disabled") << "\n";
uniqueIV = selectUniqueIV();
if (uniqueIV == 0)
opts->readOnly = 0; // Reverse supports rw mode only if uniqueIV is disabled
/* 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 (uniqueIV == false)
opts->readOnly = false;
} else {
chainedIV = selectChainedIV();
uniqueIV = selectUniqueIV();

View File

@ -83,7 +83,6 @@ int encfs_write(const char *path, const char *buf, size_t size, off_t offset,
int encfs_statfs(const char *, struct statvfs *fst);
int encfs_flush(const char *, struct fuse_file_info *info);
int encfs_fsync(const char *path, int flags, struct fuse_file_info *info);
int encfs_readonly_error(...);
#ifdef HAVE_XATTR