Commit Graph

206 Commits

Author SHA1 Message Date
benrubson
d216cc4208 Improve auto unmount 2017-06-10 18:51:15 +02:00
Johannes Bornhold
59378ae7fe Read config into memory and pass its content to tinyxml2 (#253)
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.
2017-05-28 16:24:35 +02:00
benrubson
c270963df8 Use INITIALIZE_EASYLOGGINGPP in Error.cpp 2017-04-23 14:21:36 +02:00
benrubson
c68c130724 Add option 't' to set syslog tag 2017-04-02 23:52:29 +02:00
benrubson
b1a7e0ff5e Remove timestamp from loglines
when syslog is used
2017-04-02 23:52:29 +02:00
Ben RUBSON
7295b3369b Check that llistxattr exists (#307)
This PR solves
https://github.com/vgough/encfs/issues/305 "llistxattr breaks compilation on Mac OS X"
checking whether llistxattr exists or not.
2017-04-01 19:58:05 +02:00
Ben RUBSON
7cc6efa60c Display default yes/no choice when creating initial directories
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)
2017-03-25 13:55:53 +01:00
Charles Duffy
a17f7366c2 Fix up encfssh (#258)
* 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.
2017-03-16 22:21:02 +01:00
Ben RUBSON
618db2374c Get idle counters at once (#294)
to avoid a race with usage==0 & openCount>0
2017-03-10 08:47:04 +01:00
Ben RUBSON
efbdd29716 Allow read/write in standard reverse mode (#301) 2017-03-09 22:56:37 +01:00
Taylor Raack
10e26bf488 Resolve xattrs for symlinks (resolves #247, resolves #283) 2017-02-13 22:03:43 -08:00
Jakob Unterwurzacher
5994b28542 Exit with a fatal error on empty password
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 .
2017-02-05 14:06:19 +01:00
Jakob Unterwurzacher
e9592fade4 Revert "Fix a segfault when password is zero length."
The change intended to fix a segfault when encfs is passed a zero-length
password (https://github.com/vgough/encfs/issues/241).

However, it also changed the CLI ABI which caused breakage in Cryptkeeper
(https://github.com/tomm/cryptkeeper/issues/23) and other third-party
projects that call EncFS.

Fixes https://github.com/vgough/encfs/issues/280 .

This reverts commit c3a7da5eff.
2017-02-05 14:05:36 +01:00
Charles Duffy
ecc364df0d Suggest "$@", not $*, in documentation
`$*` 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.
2016-12-22 16:37:15 -06:00
Dmitri Goutnik
afe67ab9a0 fix misplaced namespace closing brace 2016-12-10 09:59:03 -05:00
Valient Gough
559c30d01e Merge pull request #235 from rogeliodh/remove_deprecated_RAND_pseudo_bytes
remove usage of deprecated RAND_pseudo_bytes
2016-10-31 14:36:40 -07:00
Ian Lee
c3a7da5eff Fix a segfault when password is zero length.
if useStdin and configMode == Config_Prompt, default to Config_Standard,
otherwise we might read the password input at the wrong place.
2016-10-31 16:56:35 +00:00
Rogelio Domínguez Hernández
b7fc9d09d9 remove usage of deprecated RAND_pseudo_bytes
Ignore the @strongRandom in SSL_Cipher::randomize because OpenSSL does not offer a "weak" random generator
2016-10-26 12:33:36 -05:00
Tobias Geerinckx-Rice
8d7ce724c9
Miscellaneous small man page fixes (mostly typos) 2016-10-20 17:24:59 +02:00
Valient Gough
441fa20ed6 Merge pull request #230 from rogeliodh/openssl_1.1
build with openssl 1.1.0b
2016-10-17 15:46:21 -07:00
Rogelio Domínguez Hernández
0573bc500c create OpenSSL < 1.1 compat header 2016-10-16 08:37:22 -05:00
Rogelio Domínguez Hernández
2574a77536 build with openssl 1.1.0b 2016-10-15 12:37:12 -05:00
Rogelio Domínguez Hernández
0ae1d81b5e make encfssh script executable 2016-10-15 11:55:27 -05:00
Mathias Tausig
65fa9f863b Replace tmpnam with secure alternative. (Issue #200) 2016-10-06 14:11:11 +02:00
Valient Gough
9d998ca668
add filehandle null check 2016-09-18 13:03:37 -07:00
Valient Gough
f418b05ed5
prevent crash in elpp when verbose logging is enabled 2016-09-15 17:01:11 -07:00
Valient Gough
95c7d92f94
run clang-format 2016-09-08 20:27:04 +02:00
Valient Gough
d99c2e2df2
improve error handling in flush operation 2016-09-08 10:13:38 +02:00
Valient Gough
eaf2574d03
move openssl initialization earlier 2016-09-08 10:04:56 +02:00
Valient Gough
b0b4f8de4d
fix memory leak in encfsctl showKey command 2016-09-08 09:48:42 +02:00
Valient Gough
cd89e60ff2 Merge pull request #178 from jhepp/reverse-readonly
Allow writing when loading a reverse mount config
2016-08-17 02:20:22 -04:00
Charles Munson
37cf68c8c5 Bugfix: Segfault when running paranoid config in verbose mode
When "external IV chaining" is enabled, cipherName_ parameter may be
  NULL, resulting in segfault in verbose log attempt
2016-08-12 08:00:56 +02:00
Jakob Unterwurzacher
87ee4b7d99 Revert "Remove "-o default_permissions" unless needed."
Caused a regression: https://github.com/vgough/encfs/issues/112 , and
removing open_readonly_workaround caused another one. So let's just
keep it as it was.

This reverts commit 82ceb88998.
2016-06-25 15:12:04 +02:00
Jakob Unterwurzacher
4a691dc0bb Revert "Remove open_readonly_workaround"
Caused a regression: https://github.com/vgough/encfs/issues/181

Without this, "umask 0777 ; echo foo > bar" fails.

This reverts commit c2e046b694.
2016-06-25 14:55:35 +02:00
Valient Gough
426d9dae76 Merge pull request #172 from jetwhiz/fork-encfsctl-patch
Fix incorrect masking in encfsctl export's copyContents
2016-06-21 20:28:28 -07:00
jhepp
2c541474b5 Allow writing when loading a reverse mount config
- set readOnly to false when uniqueIV is false
2016-06-04 19:12:21 +02:00
Valient Gough
105a8acd60
logging: enable debug log only in verbose mode 2016-05-23 20:31:52 -07:00
Charles Munson
d2f243a195 Fix incorrect masking in encfsctl export's copyContents
Code did not properly detect when a file had S_IFLNK mode
2016-05-23 23:07:16 +02:00
Valient Gough
ad43aa10b2
use utimensat if available 2016-05-13 13:33:23 -07:00
Ian Lee
4033ca85d2 The string copy will not be shallow, due to undordere_map returning a const std::string. 2016-05-12 17:11:59 +01:00
Ian Lee
6ad5cd4225 Revert "unordered_map value type, is of std::pair<const Key, T>, hence a copy from const Key to Key is never shallow."
This reverts commit 6985c8f64c.
2016-05-12 17:03:10 +01:00
Valient Gough
3076450d34 Merge pull request #164 from vgough/readdir
replace getdir with readdir
2016-05-10 22:53:47 -07:00
Ian Lee
6985c8f64c unordered_map value type, is of std::pair<const Key, T>, hence a copy from const Key to Key is never shallow. 2016-05-10 16:32:34 +01:00
Ian Lee
af64702dd0 Simplify FileNode Cache. Remove the need for PlaceHolder.
- Store std::shared_ptr's directly, no need for PlaceHolder wrapper
 - Use std::forward_list to store shared_ptr's, the shared_ptr
   is guaranteed to be unique hence a set is an unnecessary overhead
 - Refactor code to use FileNode * instead of PlaceHolder *
2016-05-10 16:32:34 +01:00
Valient Gough
282fe77ec7
replace getdir with readdir 2016-04-30 23:10:45 -07:00
Valient Gough
ba9b25a1d2
reformat 2016-04-26 22:56:03 -07:00
Valient Gough
057a5741e7
fix trivial memory leak 2016-04-26 22:55:56 -07:00
Valient Gough
19a49b7865 Merge pull request #158 from benrubson/issue156
Improve unmount
2016-04-26 22:25:04 -07:00
Valient Gough
aacce54f42
add encfs_create, fixes #162 2016-04-26 21:49:27 -07:00
benrubson
01cdc07f95 fixes a never ending unmounting case, and log if we still have opened files 2016-04-26 08:49:29 +02:00