libgocryptfs/tests
Jakob Unterwurzacher 72b975867a fusefronted: allow_other: close race between mknod and chown
If the user manages to replace the directory with
a symlink at just the right time, we could be tricked
into chown'ing the wrong file.

This change fixes the race by using fchownat, which
unfortunately is not available on darwin, hence a compat
wrapper is added.

Scenario, as described by @slackner at
https://github.com/rfjakob/gocryptfs/issues/177 :

1. Create a forward mount point with `plaintextnames` enabled
2. Mount as root user with `allow_other`
3. For testing purposes create a file `/tmp/file_owned_by_root`
   which is owned by the root user
4. As a regular user run inside of the GoCryptFS mount:

```
mkdir tempdir
mknod tempdir/file_owned_by_root p &
mv tempdir tempdir2
ln -s /tmp tempdir
```

When the steps are done fast enough and in the right order
(run in a loop!), the device file will be created in
`tempdir`, but the `lchown` will be executed by following
the symlink. As a result, the ownership of the file located
at `/tmp/file_owned_by_root` will be changed.
2017-11-27 21:04:45 +01:00
..
cli main: Add '-devrandom' commandline option 2017-11-21 23:37:06 +01:00
defaults tests: add diriv cache race test 2017-08-10 21:01:19 +02:00
example_filesystems tests: Add test for access to encrypted version of '.' and '..' 2017-11-23 08:48:00 +01:00
hkdf_sanity tests: add hkdf_sanity tests with broken example filesystem 2017-03-18 16:48:58 +01:00
matrix fusefronted: allow_other: close race between mknod and chown 2017-11-27 21:04:45 +01:00
plaintextnames Fix misspellings 2016-10-24 19:18:13 +02:00
reverse reverse: reject too-long symlink target reads with ENAMETOOLONG 2017-11-26 21:37:12 +01:00
stress_tests tests: fsstress-gocryptfs.bash: sync up with EncFS 2017-07-21 23:34:44 +02:00
test_helpers fusefrontend: implement path decryption via ctlsock 2017-05-07 21:01:39 +02:00
canonical-benchmarks.bash benchmarks: add streaming read benchmark 2017-06-27 00:04:58 +02:00
dl-linux-tarball.bash tests: OSX compat: use OSX-style "stat -f" 2017-02-16 19:10:36 +01:00
fuse-unmount.bash OSX compat: replace fusermount calls with fuse-unmount.bash 2017-02-15 23:02:01 +01:00
maxlen.bash maxlen.bash: result was 1 too high 2016-10-04 10:26:22 +02:00