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:
Jakob Unterwurzacher 2014-11-30 22:28:12 +01:00
parent 91919929dd
commit 34d15bbeaa

View File

@ -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) {