mirror of
https://github.com/vgough/encfs.git
synced 2025-02-16 17:50:53 +01:00
Remove buggy prefix check from plainPath
In reverse mode, this caused symlinks pointing to the absolute plaintext directory to be stripped. This is what the test in commit tests: reverse: symlink absolute path inside the plaintext dir checks for. Ignoring encfsctl, plainPath() is only called from encfs.cpp, in _do_readlink() and _do_getattr(). Both functions get the path passed in from FUSE. Paths from FUSE are always anchored at the mountpoint (they start with "/", and "/" means the root of the mount). This suggests that the check can never trigger - I have verified that it does not trigger when running the test suite. With this patch, the full test suite passes.
This commit is contained in:
parent
91919929dd
commit
34d15bbeaa
@ -285,10 +285,6 @@ string DirNode::cipherPathWithoutRoot(const char *plaintextPath) {
|
||||
|
||||
string DirNode::plainPath(const char *cipherPath_) {
|
||||
try {
|
||||
if (!strncmp(cipherPath_, rootDir.c_str(), rootDir.length())) {
|
||||
return naming->decodePath(cipherPath_ + rootDir.length());
|
||||
}
|
||||
|
||||
// Handle special absolute path encodings.
|
||||
char mark = fsConfig->reverseEncryption ? '/' : '+';
|
||||
if (cipherPath_[0] == mark) {
|
||||
|
Loading…
Reference in New Issue
Block a user