Unmounting leftover mounts is a convenience function for developers,
but it would need to be expanded to work on MacOS and FreeBSD, which
adds more complexity.
Let's keep test.sh at the bare minimum that is needed for its purpose:
running the tests.
We had the situation that "make test" runs the test suite but does not
show useful error messages (see
https://github.com/vgough/encfs/issues/358 for an example).
"make check" did the right thing by using the "--output-on-failure"
feature, but depended on "make test" being available as well. This
means users will continue to run "make test".
This commits drops the cmake test logic and adds a dumb "make test"
target that simply runs test.sh.
gcc is default compiler on most distributions, we should
also test with it.
build.sh exists and should be tested as well, so why not use
it in Travis.
test.sh outputs much more details than "make check", so
run it as well.
Additionally, make build.sh and test.sh work when called from
other directories.
On July 18, Travis upgraded their default build VM
to Ubuntu Trusty. Trusty has cmake 3.5.1, which allows us to
drop our bundled version.
We explicitely set "dist: trusty" to prevent our build jobs
from being routed to an older build VM.
When a file is opened twice concurrently, we can end up with
two separate FileNodes for a single path.
This seems to be the root cause for the crashes reported under
https://github.com/vgough/encfs/issues/214 , as commit
af64702dd0
"Simplify FileNode Cache. Remove the need for PlaceHolder."
removed the awareness for different FileNodes.
The crashes have been fixed by
e2f0f8e3c6
"fuseFhMap: translate FUSE file handles to FileNode pointers"
at the cost of introducing a memory leak. One of the two FileNodes
would stay in fuseFhMap forever.
This commit makes eraseNode again aware of different FileNodes for
a single path, makes sure the right FileNode is erased, and fixes
the memory leak.
Previously, we used raw pointers to the FileNode as FUSE file handles.
With this change, we instead pass an arbitrary value (a uint64 counter)
to the kernel as FUSE file handle, and use the "fuseFhMap" look-up table
to convert back to the FileNode pointer.
This gets rid of a lot of scary void pointer casts. The performance
cost is not measurable.
The do_op closure is complicated enough. Get the canary check out
of the way to not make it even more complicated.
Also, use an explicitely atomic type for the canary.
We run through everything in normal.t.pl two times, once
in "standard" mode and once in "paranoia" mode. Print some
context. Also, bail out if file creation fails.
Output now looks like this:
$ ./test.sh
tests/normal.t.pl ...
runTests: mode=standard
tests/normal.t.pl ... 54/116
runTests: mode=paranoia
tests/normal.t.pl ... ok
tests/reverse.t.pl .. ok
All tests successful.
Files=2, Tests=141, 21 wallclock secs ( 0.04 usr 0.00 sys + 20.03 cusr 0.36 csys = 20.43 CPU)
Result: PASS
The tinyxml2 library used by Arch Linux represents
booleans as "true" and "false" instead of "0" and "1".
These fail to load when read back later and will always be
interpreted as false, as seen in
https://github.com/vgough/encfs/issues/343 .
Cast the booleans to int to force representation
as "0" and "1" in all tinyxml2 variants.
Adds a uint32 value to FileNode that is initialized to an
arbitrary value (CANARY_OK) in the constructor, and reset
when the reference is dropped (CANARY_RELEASED,
CANARY_DESTROYED).
The canary is checked on each withFileNode call.
Makes it much easier to trigger the bug seen in
https://github.com/vgough/encfs/issues/214 .
tinyxml2 does not support to read from a named pipe, since it uses seek to
figure out the file size. In the case of a pipe this is not possible.
Reading the file content into memory and passing the content to tinyxml2 allows
to mitigate this problem.
* Update cmake
* Update cmake, make Travis use it
* Enable all tests in a single command : make check
* Make cmake flawlessly run with Debian jessie cmake 3.0.2
* Make Travis use our own cmake 3.0.2 compiled version
* Typo in preferred version
* Be sure travis will have gettext
Currently the text displayed is
The directory "..." does not exist. Should it be created? (y,n)
This patch changes it to
The directory "..." does not exist. Should it be created? (y,N)
* Fix up encfssh
The original implementation of encfssh had several issues:
- Could not safely handle directory names with spaces
- Could not safely handle paths starting with a dash (`-`)
- Option strings could not be passed with spaces
- Could print incorrect help based on filenames in current directory
- Used `test` syntax deprecated in current POSIX.2 standard
- Had shell injection vulnerabilities based on both current working directory
and mount-point directory names.
- Failures of the canonicalize function could silently return the current
directory rather than the target.
In this version, shell injection is only permitted through the (explicitly
defined) `FUSE_UMOUNT` mechanism.
This version also adds support for the GNU-style "--help" argument.
The requirement that the password is not empty was not enforced
properly in all getUserKey() variants. Add the check to makeKey()
instead that is called in every code path.
This also fixes the crash desribed at https://github.com/vgough/encfs/issues/241 .