<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gocryptfs/internal/fusefrontend/node.go, branch xattr_user_buffer</title>
<subtitle>Mirror of gocryptfs source code on Github</subtitle>
<id>http://nuetzlich.net/cgit/gocryptfs/atom?h=xattr_user_buffer</id>
<link rel='self' href='http://nuetzlich.net/cgit/gocryptfs/atom?h=xattr_user_buffer'/>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/'/>
<updated>2025-06-15T18:11:06+00:00</updated>
<entry>
<title>fusefronted: fake fstat for deleted fifos</title>
<updated>2025-06-15T18:11:06+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2025-06-15T17:52:21+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=4ef2678917ddc26ab8e5f64a3158720da6e0a5d1'/>
<id>urn:sha1:4ef2678917ddc26ab8e5f64a3158720da6e0a5d1</id>
<content type='text'>
git test suite t9300-fast-import.sh test 245 does the equivalent of this:

	mkfifo fifo
	exec 8&lt;&gt;fifo
	rm fifo
	cat /dev/null &gt;&amp;8

This used to fail with

	cat: standard output: No such file or directory

because cat tries to fstat stdout.

The open() on the fifo does not reach the filesystem, so we don't
have an fd open for the delted file, hence no way to access it.

Fake fstat success as good as we can to make cat happy.

Fixes https://github.com/rfjakob/gocryptfs/issues/929
</content>
</entry>
<entry>
<title>fusefrontend: fix unconditional FileGetattrer cast</title>
<updated>2025-03-26T21:50:54+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2025-03-26T21:50:54+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=810f074e75b4251b1520843b42c204e5a6e376d8'/>
<id>urn:sha1:810f074e75b4251b1520843b42c204e5a6e376d8</id>
<content type='text'>
Essentially a port of
https://github.com/hanwen/go-fuse/commit/531a68551e40e7303e94b53fb3792e6dfb28d15a .

This fixes

	panic: interface conversion: *fs.dirStreamAsFile is not fs.FileGetattrer: missing method Getattr

	goroutine 20 [running]:
	github.com/rfjakob/gocryptfs/v2/internal/fusefrontend.(*Node).Getattr(0x55a7ac9d9090?, {0x55a7ac85a4d8, 0xc0013401c8}, {0x55a7ac80eb40?, 0xc0013401b0}, 0xc000586938)
		github.com/rfjakob/gocryptfs/v2/internal/fusefrontend/node.go:74 +0x22c
	github.com/hanwen/go-fuse/v2/fs.(*rawBridge).getattr(0xc0000b6180, {0x55a7ac85a4d8, 0xc0013401c8}, 0xc0010ea160, {0x55a7ac80eb40?, 0xc0013401b0}, 0xc000586938)
		github.com/hanwen/go-fuse/v2@v2.7.2/fs/bridge.go:569 +0x9b
	[...]

which is a bug exposed by a go-fuse update.

Fixes https://github.com/rfjakob/gocryptfs/issues/897
</content>
</entry>
<entry>
<title>fusefrontend: implement our own Access()</title>
<updated>2023-05-17T21:26:56+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2023-05-17T21:26:56+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=09954c4bdecf0ca6da65776f176dc934ffced2b0'/>
<id>urn:sha1:09954c4bdecf0ca6da65776f176dc934ffced2b0</id>
<content type='text'>
Not having Access() means go-fuse emulates it by looking at Getattr().
This works fine most of the time, but breaks down on sshfs, where
sshfs-benchmark.bash shows this:

	gocryptfs/tests$ ./sshfs-benchmark.bash nuetzlich.net
	working directory: /tmp/sshfs-benchmark.bash.JQC
	sshfs mounted: nuetzlich.net:/tmp -&gt; sshfs.mnt
	gocryptfs mounted: sshfs.mnt/sshfs-benchmark.bash.Wrz/gocryptfs.crypt -&gt; gocryptfs.mnt

	sshfs-benchmark.bash:    sshfs  gocryptfs-on-sshfs
	git init                  3.98                6.80
	rsync                     7.71               10.84
	rm -R                     4.30rm: descend into write-protected directory 'gocryptfs.mnt/git1'?

The go-fuse emulation gets it wrong here because sshfs reports
permissions but does not enforce them.

Implement it ourselves properly.
</content>
</entry>
<entry>
<title>fusefrontent: report correct size on hard link creation</title>
<updated>2023-03-29T20:16:14+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2023-03-29T20:16:14+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=24b3978715186bed3edc2703e81f165a73c0a74a'/>
<id>urn:sha1:24b3978715186bed3edc2703e81f165a73c0a74a</id>
<content type='text'>
And add a test for it.

Fixes https://github.com/rfjakob/gocryptfs/issues/724
</content>
</entry>
<entry>
<title>fusefrontend: support RENAME_WHITEOUT, RENAME_EXCHANGE</title>
<updated>2022-01-22T11:28:27+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2022-01-22T11:28:27+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=b7cac4ffd07733ab6bcd0d33345de3306a8a5a59'/>
<id>urn:sha1:b7cac4ffd07733ab6bcd0d33345de3306a8a5a59</id>
<content type='text'>
Both new internal test and xfstests generic/013 are happy.

https://github.com/rfjakob/gocryptfs/issues/641
</content>
</entry>
<entry>
<title>fusefrontend: fix -force_owner not affecting MKNOD</title>
<updated>2022-01-10T19:05:36+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2022-01-10T19:05:36+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=5f955423b736d56b5b741fbd1b853c83044aa0fe'/>
<id>urn:sha1:5f955423b736d56b5b741fbd1b853c83044aa0fe</id>
<content type='text'>
Fixes https://github.com/rfjakob/gocryptfs/issues/629
</content>
</entry>
<entry>
<title>fusefrontend: honor ForceOwner for LOOKUP and CREATE operations</title>
<updated>2021-10-15T15:35:12+00:00</updated>
<author>
<name>Charles Duffy</name>
</author>
<published>2021-10-08T20:54:41+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=8ec872e330985a2de87c3b15d6c49ab9e3281573'/>
<id>urn:sha1:8ec872e330985a2de87c3b15d6c49ab9e3281573</id>
<content type='text'>
</content>
</entry>
<entry>
<title>go mod: declare module version v2</title>
<updated>2021-08-23T13:05:15+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-08-23T13:05:15+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=69d88505fd7f4cb0d9e4f1918de296342fe05858'/>
<id>urn:sha1:69d88505fd7f4cb0d9e4f1918de296342fe05858</id>
<content type='text'>
Our git version is v2+ for some time now, but go.mod
still declared v1. Hopefully making both match makes
https://pkg.go.dev/github.com/rfjakob/gocryptfs/v2 work.

All the import paths have been fixed like this:

  find . -name \*.go | xargs sed -i s%github.com/rfjakob/gocryptfs/%github.com/rfjakob/gocryptfs/v2/%
</content>
</entry>
<entry>
<title>golangci-lint: fix issues found by gosimple</title>
<updated>2021-08-19T06:34:44+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-08-19T05:51:47+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=c86981342b46875525f2b214687553e23e58eb1a'/>
<id>urn:sha1:c86981342b46875525f2b214687553e23e58eb1a</id>
<content type='text'>
Everything except the

	if err2.Err == syscall.EOPNOTSUPP

case. Gets too confusing when collapsed into a single line.

Issues were:

$ golangci-lint run --disable-all --enable gosimple
mount.go:473:2: S1008: should use 'return strings.HasPrefix(v, "fusermount version")' instead of 'if strings.HasPrefix(v, "fusermount version") { return true }; return false' (gosimple)
	if strings.HasPrefix(v, "fusermount version") {
	^
cli_args.go:258:5: S1002: should omit comparison to bool constant, can be simplified to `args.forcedecode` (gosimple)
	if args.forcedecode == true {
	   ^
cli_args.go:263:6: S1002: should omit comparison to bool constant, can be simplified to `args.aessiv` (gosimple)
		if args.aessiv == true {
		   ^
cli_args.go:267:6: S1002: should omit comparison to bool constant, can be simplified to `args.reverse` (gosimple)
		if args.reverse == true {
		   ^
internal/stupidgcm/stupidgcm.go:227:6: S1002: should omit comparison to bool constant, can be simplified to `g.forceDecode` (gosimple)
		if g.forceDecode == true {
		   ^
gocryptfs-xray/xray_tests/xray_test.go:23:5: S1004: should use !bytes.Equal(out, expected) instead (gosimple)
	if bytes.Compare(out, expected) != 0 {
	   ^
gocryptfs-xray/xray_tests/xray_test.go:40:5: S1004: should use !bytes.Equal(out, expected) instead (gosimple)
	if bytes.Compare(out, expected) != 0 {
	   ^
gocryptfs-xray/paths_ctlsock.go:34:20: S1002: should omit comparison to bool constant, can be simplified to `!eof` (gosimple)
	for eof := false; eof == false; line++ {
	                  ^
tests/reverse/xattr_test.go:19:2: S1008: should use 'return err2.Err != syscall.EOPNOTSUPP' instead of 'if err2.Err == syscall.EOPNOTSUPP { return false }; return true' (gosimple)
	if err2.Err == syscall.EOPNOTSUPP {
	^
internal/fusefrontend/node.go:459:45: S1002: should omit comparison to bool constant, can be simplified to `!nameFileAlreadyThere` (gosimple)
		if nametransform.IsLongContent(cName2) &amp;&amp; nameFileAlreadyThere == false {
		                                          ^
tests/xattr/xattr_integration_test.go:221:2: S1008: should use 'return err2.Err != syscall.EOPNOTSUPP' instead of 'if err2.Err == syscall.EOPNOTSUPP { return false }; return true' (gosimple)
	if err2.Err == syscall.EOPNOTSUPP {
	^
tests/test_helpers/helpers.go:338:19: S1002: should omit comparison to bool constant, can be simplified to `open` (gosimple)
	if err != nil &amp;&amp; open == true {
	                 ^
tests/matrix/concurrency_test.go:121:7: S1004: should use !bytes.Equal(buf, content) instead (gosimple)
			if bytes.Compare(buf, content) != 0 {
			   ^
</content>
</entry>
<entry>
<title>Fix issues found by ineffassign</title>
<updated>2021-08-18T13:48:01+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-08-18T13:47:17+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=64793fedf4ac8eebe05c57af75877944c60f03a4'/>
<id>urn:sha1:64793fedf4ac8eebe05c57af75877944c60f03a4</id>
<content type='text'>
gocryptfs$ ineffassign ./...

/home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/configfile/config_file.go:243:2: ineffectual assignment to scryptHash
/home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/configfile/config_file.go:272:2: ineffectual assignment to scryptHash
/home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/file.go:285:3: ineffectual assignment to fileID
/home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/node.go:367:3: ineffectual assignment to err
/home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/node_open_create.go:68:2: ineffectual assignment to fd
/home/jakob/go/src/github.com/rfjakob/gocryptfs/mount.go:308:2: ineffectual assignment to masterkey
/home/jakob/go/src/github.com/rfjakob/gocryptfs/gocryptfs-xray/xray_main.go:156:13: ineffectual assignment to err
/home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/prepare_syscall_test.go:65:16: ineffectual assignment to errno
/home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/syscallcompat/open_nofollow_test.go:34:2: ineffectual assignment to fd
/home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/acl_test.go:111:6: ineffectual assignment to err
/home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/acl_test.go:181:2: ineffectual assignment to sz
/home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/acl_test.go:198:2: ineffectual assignment to sz
/home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/main_test.go:365:8: ineffectual assignment to err
/home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/xattr/xattr_fd_test.go:30:6: ineffectual assignment to err
/home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/xattr/xattr_fd_test.go:66:6: ineffectual assignment to err
</content>
</entry>
</feed>
