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 .
`$*` operates by:
- Concatenating all arguments with the first character in `IFS` (by default a space) into a single string
- Splitting that string on all characters found in `IFS` to join a list of words
- Expanding each of those words as a glob character
Thus, using `$*` in a wrapper means that an argument such as `"one word"` becomes two arguments, `one` and `word`, and an argument `'*.txt'` can be replaced with an entirely unknown number of arguments (`one.txt`, `two.txt`) despite its quoting.
Use `"$@"` to pass an argument vector through literally without any kind of expansion.