libgocryptfs/internal/nametransform
Jakob Unterwurzacher 7d38f80a78 nametransform: WriteDirIV: replace ioutil.WriteFile
As reported at https://github.com/rfjakob/gocryptfs/issues/105 ,
the "ioutil.WriteFile(file, iv, 0400)" call causes "permissions denied"
errors on an NFSv4 setup.

"strace"ing diriv creation and gocryptfs.conf creation shows this:

conf (works on the user's NFSv4 mount):
openat(AT_FDCWD, "/tmp/a/gocryptfs.conf.tmp", O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0400) = 3

diriv (fails):
openat(AT_FDCWD, "/tmp/a/gocryptfs.diriv", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0400) = 3

This patch creates the diriv file with the same flags that are used for
creating the conf:
openat(AT_FDCWD, "/tmp/a/gocryptfs.diriv", O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0400) = 3

Closes https://github.com/rfjakob/gocryptfs/issues/105
2017-04-29 14:15:13 +02:00
..
diriv.go nametransform: WriteDirIV: replace ioutil.WriteFile 2017-04-29 14:15:13 +02:00
diriv_cache.go fusefronted: expire dir IV cache after one second 2016-11-01 10:57:39 +01:00
longnames.go nametransform: fix Raw64 not affecting symlink targets 2017-03-05 22:59:25 +01:00
longnames_test.go longnames: fix fsstress failure, use dirfd 2016-04-10 21:31:08 +02:00
names.go nametransform: fix Raw64 not affecting symlink targets 2017-03-05 22:59:25 +01:00
names_test.go nametransform: drop unused noiv functions 2016-06-23 21:39:04 +02:00
pad16.go Replace all calls to naked panic() with log.Panic() 2016-12-10 11:54:36 +01:00