From b28b97999e73519acdea0f39a1541ea2459bb115 Mon Sep 17 00:00:00 2001 From: Valient Gough Date: Thu, 26 Apr 2012 02:15:38 +0000 Subject: [PATCH] fix encfsctl cat when iv chaining is enabled. Fixes issue #132 git-svn-id: http://encfs.googlecode.com/svn/trunk@77 db9cf616-1c43-0410-9cb8-a902689de0d6 --- encfs/DirNode.cpp | 8 -------- encfs/DirNode.h | 4 ---- encfs/encfsctl.cpp | 5 +++-- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/encfs/DirNode.cpp b/encfs/DirNode.cpp index 91a6580..18429f1 100644 --- a/encfs/DirNode.cpp +++ b/encfs/DirNode.cpp @@ -742,14 +742,6 @@ shared_ptr DirNode::renameNode( const char *from, const char *to, return node; } -shared_ptr DirNode::directLookup( const char *path ) -{ - return shared_ptr( - new FileNode( this, - fsConfig, - "unknown", path )); -} - shared_ptr DirNode::findOrCreate( const char *plainName) { shared_ptr node; diff --git a/encfs/DirNode.h b/encfs/DirNode.h index 2f413f8..f075a8a 100644 --- a/encfs/DirNode.h +++ b/encfs/DirNode.h @@ -108,10 +108,6 @@ public: shared_ptr openNode( const char *plaintextName, const char *requestor, int flags, int *openResult ); - /* For internal use - open a cipher file directly - */ - shared_ptr directLookup( const char *realPath ); - std::string cipherPath( const char *plaintextPath ); std::string cipherPathWithoutRoot( const char *plaintextPath ); std::string plainPath( const char *cipherPath ); diff --git a/encfs/encfsctl.cpp b/encfs/encfsctl.cpp index a75aa94..369c37a 100644 --- a/encfs/encfsctl.cpp +++ b/encfs/encfsctl.cpp @@ -411,8 +411,9 @@ int processContents( const shared_ptr &rootInfo, if(!node) { - // try opening directly, so a cipher-path can be passed in - node = rootInfo->root->directLookup( path ); + // try treating filename as an enciphered path + string plainName = rootInfo->root->plainPath( path ); + node = rootInfo->root->lookupNode( plainName.c_str(), "encfsctl" ); if(node) { errCode = node->open( O_RDONLY );