From 93b53e7b38bb8b19d9d0ffbb72b08f7f17c94a06 Mon Sep 17 00:00:00 2001 From: joshkayse Date: Mar 11 2010 02:55:22 +0000 Subject: update to 1.4.2 to build for el5 --- diff --git a/.cvsignore b/.cvsignore index cbceecc..43ebbec 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -encfs-1.3.2-1.tgz +encfs-1.4.2.tgz diff --git a/encfs--rlog.diff b/encfs--rlog.diff new file mode 100644 index 0000000..311444f --- /dev/null +++ b/encfs--rlog.diff @@ -0,0 +1,275 @@ +diff -ru encfs-1.4.2/encfs/DirNode.cpp encfs-1.4.2.rlog/encfs/DirNode.cpp +--- encfs-1.4.2/encfs/DirNode.cpp 2008-04-14 03:13:23.000000000 +0400 ++++ encfs-1.4.2.rlog/encfs/DirNode.cpp 2008-08-01 11:43:41.000000000 +0400 +@@ -188,100 +188,105 @@ + { + } + +- ~RenameOp() +- { +- if(renameList) +- { +- // got a bunch of decoded filenames sitting in memory.. do a little +- // cleanup before leaving.. +- list::iterator it; +- for(it = renameList->begin(); it != renameList->end(); ++it) +- { +- it->oldPName.assign( it->oldPName.size(), ' ' ); +- it->newPName.assign( it->newPName.size(), ' ' ); +- } +- } +- } ++ ~RenameOp(); + + operator bool () const + { + return renameList; + } + +- bool apply() ++ bool apply(); ++ void undo(); ++}; ++ ++RenameOp::~RenameOp() ++{ ++ if(renameList) + { +- try +- { +- while(last != renameList->end()) +- { +- // backing store rename. +- rDebug("renaming %s -> %s", +- last->oldCName.c_str(), last->newCName.c_str()); +- +- // internal node rename.. +- dn->renameNode( last->oldPName.c_str(), +- last->newPName.c_str() ); +- +- // rename on disk.. +- if(::rename( last->oldCName.c_str(), +- last->newCName.c_str() ) == -1) +- { +- rWarning("Error renaming %s: %s", +- last->oldCName.c_str(), strerror( errno )); +- dn->renameNode( last->newPName.c_str(), +- last->oldPName.c_str(), false ); +- return false; +- } ++ // got a bunch of decoded filenames sitting in memory.. do a little ++ // cleanup before leaving.. ++ list::iterator it; ++ for(it = renameList->begin(); it != renameList->end(); ++it) ++ { ++ it->oldPName.assign( it->oldPName.size(), ' ' ); ++ it->newPName.assign( it->newPName.size(), ' ' ); ++ } ++ } ++} + +- ++last; +- } ++bool RenameOp::apply() ++{ ++ try ++ { ++ while(last != renameList->end()) ++ { ++ // backing store rename. ++ rDebug("renaming %s -> %s", ++ last->oldCName.c_str(), last->newCName.c_str()); ++ ++ // internal node rename.. ++ dn->renameNode( last->oldPName.c_str(), ++ last->newPName.c_str() ); ++ ++ // rename on disk.. ++ if(::rename( last->oldCName.c_str(), ++ last->newCName.c_str() ) == -1) ++ { ++ rWarning("Error renaming %s: %s", ++ last->oldCName.c_str(), strerror( errno )); ++ dn->renameNode( last->newPName.c_str(), ++ last->oldPName.c_str(), false ); ++ return false; ++ } + +- return true; +- } catch( rlog::Error &err ) +- { +- err.log( _RLWarningChannel ); +- return false; +- } ++ ++last; ++ } ++ ++ return true; ++ } catch( rlog::Error &err ) ++ { ++ err.log( _RLWarningChannel ); ++ return false; + } ++} ++ ++void RenameOp::undo() ++{ ++ rDebug("in undoRename"); + +- void undo() ++ if(last == renameList->begin()) + { +- rDebug("in undoRename"); ++ rDebug("nothing to undo"); ++ return; // nothing to undo ++ } + +- if(last == renameList->begin()) +- { +- rDebug("nothing to undo"); +- return; // nothing to undo +- } ++ // list has to be processed backwards, otherwise we may rename ++ // directories and directory contents in the wrong order! ++ int undoCount = 0; ++ list::const_iterator it = last; + +- // list has to be processed backwards, otherwise we may rename +- // directories and directory contents in the wrong order! +- int undoCount = 0; +- list::const_iterator it = last; ++ while( it != renameList->begin() ) ++ { ++ --it; + +- while( it != renameList->begin() ) +- { +- --it; ++ rDebug("undo: renaming %s -> %s", ++ it->newCName.c_str(), it->oldCName.c_str()); + +- rDebug("undo: renaming %s -> %s", +- it->newCName.c_str(), it->oldCName.c_str()); ++ ::rename( it->newCName.c_str(), it->oldCName.c_str() ); ++ try ++ { ++ dn->renameNode( it->newPName.c_str(), ++ it->oldPName.c_str(), false ); ++ } catch( rlog::Error &err ) ++ { ++ err.log( _RLWarningChannel ); ++ // continue on anyway... ++ } ++ ++undoCount; ++ }; + +- ::rename( it->newCName.c_str(), it->oldCName.c_str() ); +- try +- { +- dn->renameNode( it->newPName.c_str(), +- it->oldPName.c_str(), false ); +- } catch( rlog::Error &err ) +- { +- err.log( _RLWarningChannel ); +- // continue on anyway... +- } +- ++undoCount; +- }; +- +- rWarning("Undo rename count: %i", undoCount); +- } +-}; ++ rWarning("Undo rename count: %i", undoCount); ++} + + DirNode::DirNode(EncFS_Context *_ctx, + const string &sourceDir, const shared_ptr &_config) +@@ -550,7 +555,7 @@ + string cyName = rootDir + naming->encodePath( plaintextPath ); + rAssert( !cyName.empty() ); + +- rLog( Info, "mkdir on %s", cyName.c_str() ); ++ rLog( Info, "mkdir on %s, mode %i", cyName.c_str(), mode ); + + // if uid or gid are set, then that should be the directory owner + int olduid = -1; +@@ -770,6 +775,22 @@ + return shared_ptr(); + } + ++shared_ptr ++DirNode::openNode( const char *plainName, mode_t mode, int flags, int *result ) ++{ ++ rAssert( result != NULL ); ++ Lock _lock( mutex ); ++ ++ shared_ptr node = findOrCreate( plainName ); ++ ++#if 0 ++ if( node && (*result = node->create( mode, flags )) >= 0 ) ++ return node; ++ else ++#endif ++ return shared_ptr(); ++} ++ + int DirNode::unlink( const char *plaintextName ) + { + string cyName = naming->encodePath( plaintextName ); +diff -ru encfs-1.4.2/encfs/DirNode.h encfs-1.4.2.rlog/encfs/DirNode.h +--- encfs-1.4.2/encfs/DirNode.h 2008-04-14 03:13:23.000000000 +0400 ++++ encfs-1.4.2.rlog/encfs/DirNode.h 2008-08-01 11:27:24.000000000 +0400 +@@ -134,6 +134,9 @@ + */ + shared_ptr openNode( const char *plaintextName, + const char *requestor, int flags, int *openResult ); ++ ++ shared_ptr openNode( const char *plaintextName, ++ mode_t mode, int flags, int *openResult ); + + std::string cipherPath( const char *plaintextPath ); + std::string plainPath( const char *cipherPath ); +diff -ru encfs-1.4.2/encfs/encfs.cpp encfs-1.4.2.rlog/encfs/encfs.cpp +--- encfs-1.4.2/encfs/encfs.cpp 2008-04-14 03:58:03.000000000 +0400 ++++ encfs-1.4.2.rlog/encfs/encfs.cpp 2008-08-01 11:27:24.000000000 +0400 +@@ -552,6 +552,40 @@ + return withCipherPath( "utimens", path, _do_utimens, ts ); + } + ++int encfs_create(const char *path, mode_t mode, struct fuse_file_info *fi) ++{ ++ EncFS_Context *ctx = context(); ++ ++ int res = -EIO; ++ shared_ptr FSRoot = ctx->getRoot(&res); ++ if(!FSRoot) ++ return res; ++ ++ try ++ { ++ shared_ptr fnode = ++ FSRoot->openNode( path, mode, fi->flags, &res ); ++ ++ if(fnode) ++ { ++ rLog(Info, "encfs_create for %s, flags %i", fnode->cipherName(), ++ fi->flags); ++ ++ if( res >= 0 ) ++ { ++ fi->fh = (uintptr_t)ctx->putNode(path, fnode); ++ res = ESUCCESS; ++ } ++ } ++ } catch( rlog::Error &err ) ++ { ++ rError("error caught in create"); ++ err.log( _RLWarningChannel ); ++ } ++ ++ return res; ++} ++ + int encfs_open(const char *path, struct fuse_file_info *file) + { + EncFS_Context *ctx = context(); diff --git a/encfs-1.4.2.tgz.asc b/encfs-1.4.2.tgz.asc new file mode 100644 index 0000000..8dac960 --- /dev/null +++ b/encfs-1.4.2.tgz.asc @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.6 (GNU/Linux) + +iD8DBQBIAqFPWp20Ay6vTYARAqRxAJ0WU2bUbVIlCcqfTT0HabmOcAC1BwCfUPEj +3kHrDP/LbmUYLyqd5mMMDp0= +=4DTR +-----END PGP SIGNATURE----- diff --git a/encfs-1.5-const.patch b/encfs-1.5-const.patch new file mode 100644 index 0000000..a246912 --- /dev/null +++ b/encfs-1.5-const.patch @@ -0,0 +1,12 @@ +diff -ru encfs-1.5.orig/encfs/NameIO.cpp encfs-1.5/encfs/NameIO.cpp +--- encfs-1.5.orig/encfs/NameIO.cpp 2009-03-03 14:56:44.000000000 +0000 ++++ encfs-1.5/encfs/NameIO.cpp 2009-03-03 14:57:02.000000000 +0000 +@@ -190,7 +190,7 @@ + } else + { + bool isDotFile = (*path == '.'); +- char *next = strchr( path, '/' ); ++ const char *next = strchr( path, '/' ); + int len = next ? next - path : strlen( path ); + + // at this point we know that len > 0 diff --git a/fuse-encfs.spec b/fuse-encfs.spec index 21abc41..8002042 100644 --- a/fuse-encfs.spec +++ b/fuse-encfs.spec @@ -1,16 +1,22 @@ Name: fuse-encfs -Version: 1.3.2 +Version: 1.4.2 Release: 1%{?dist} Summary: Encrypted pass-thru filesystem in userspace -License: GPL +License: GPLv3+ Group: System Environment/Kernel -Url: http://arg0.net/wiki/encfs -Source: http://arg0.net/vgough/download/encfs-%{version}-1.tgz +Url: http://www.arg0.net/encfs +Source0: http://encfs.googlecode.com/files/encfs-%{version}.tgz +Source1: http://encfs.googlecode.com/files/encfs-%{version}.tgz.asc +Patch0: encfs-1.5-const.patch +Patch1: encfs--rlog.diff BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires: fuse >= 2.2 +Requires: fuse >= 2.6 +Provides: encfs = %{version}-%{release} BuildRequires: rlog-devel >= 1.3 BuildRequires: openssl-devel -BuildRequires: fuse-devel >= 2.2 +BuildRequires: boost-devel +BuildRequires: fuse-devel >= 2.6 +BuildRequires: gettext %description EncFS implements an encrypted filesystem in userspace using FUSE. FUSE @@ -21,15 +27,19 @@ it does not use NFS. %prep %setup -q -n encfs-%{version} +%patch0 -p1 -b .const +%patch1 -p1 -b .rlog %build -%configure --disable-static -%{__make} %{?_smp_mflags} +%configure --disable-static --with-boost-libdir=%{_libdir} +%{__make} LDFLAGS="-lboost_filesystem" %{?_smp_mflags} %install %{__rm} -rf %{buildroot} -%makeinstall +%{__make} DESTDIR=%{buildroot} install %{__rm} -f %{buildroot}/%{_libdir}/*.la +%{__rm} -f %{buildroot}/%{_libdir}/*.so +%find_lang encfs %post -p /sbin/ldconfig @@ -38,15 +48,20 @@ it does not use NFS. %clean %{__rm} -rf %{buildroot} -%files +%files -f encfs.lang %defattr(-, root, root, -) %doc AUTHORS COPYING ChangeLog README %{_bindir}/* %{_libdir}/libencfs.so* -%{_datadir}/locale/*/LC_MESSAGES/encfs.mo %{_mandir}/man1/* %changelog +* Wed Mar 10 2010 Josh Kayse 1.4.2-1 +- Update to 1.4.2 +- include patch for rlog +- include patch for const string +- pass boost_filesystem to the LDFLAGS when building + * Thu Apr 12 2007 Peter Lemenkov 1.3.2-1 - Version 1.3.2 diff --git a/sources b/sources index 11d5cb3..2501ac0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -71482dbe0e158ee9ba522ae637337230 encfs-1.3.2-1.tgz +61e42ab2093b9797b9c669b9a1ff665b encfs-1.4.2.tgz