From 3ac282047ff36affb86f260b54ff50653007fdee Mon Sep 17 00:00:00 2001 From: maximilize Date: Fri, 26 Jun 2026 00:23:30 +0200 Subject: reverse: hide custom -config file located inside CIPHERDIR In reverse mode, a custom config file passed via -config that lives inside CIPHERDIR was presented as an ordinary encrypted file in the encrypted view, which is useless and confusing. By default the config is mapped to a virtual gocryptfs.conf, but ConfigCustom skips that mapping, so an in-CIPHERDIR custom config was neither mapped nor hidden. Plumb the config path into the reverse RootNode and treat a custom config file located inside CIPHERDIR as excluded in isExcludedPlain, hiding it from both readdir and lookup. Also document the -config reverse-mode behaviour in MANPAGE.md and add a regression test. Fixes #1009 --- Documentation/MANPAGE.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Documentation') diff --git a/Documentation/MANPAGE.md b/Documentation/MANPAGE.md index 64bbaa8..3ef6500 100644 --- a/Documentation/MANPAGE.md +++ b/Documentation/MANPAGE.md @@ -457,6 +457,14 @@ Use specified config file instead of `CIPHERDIR/gocryptfs.conf`. Applies to: all actions that use a config file: mount, `-fsck`, `-passwd`, `-info`, `-init`. +In `-reverse` mode, this also changes what the encrypted view contains: by +default the config is exposed there as a virtual `gocryptfs.conf` (so a backup +of the encrypted view is self-contained), but with `-config` no `gocryptfs.conf` +is presented. Make sure to back up the config file (or the master key) from its +custom location separately, otherwise the encrypted data cannot be decrypted. +If the custom config file is located inside `CIPHERDIR`, it is hidden from the +encrypted view rather than exposed in encrypted form. + #### -cpuprofile string Write cpu profile to specified file. -- cgit v1.2.3