Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to listen to unix domain socket inside bindfs mount #31

Closed
slonopotamus opened this issue Jul 11, 2023 · 7 comments
Closed

Unable to listen to unix domain socket inside bindfs mount #31

slonopotamus opened this issue Jul 11, 2023 · 7 comments

Comments

@slonopotamus
Copy link

slonopotamus commented Jul 11, 2023

binfs build instructions: mpartel/bindfs#100 (comment)

Minimal way to reproduce:

(as root)

$ mkdir a
$ mkdir b
$ bindfs a b
$ nc -U b/sock -l
nc: Input/output error
$ nc -U a/sock -l
<works>

My environment: macOS Ventura + fuse-t 1.0.23 + bindfs 1.17.3

Note that the same steps do work on Linux + netcat-openbsd.

bindfs devs believe the root of the issue is not in bindfs itself: mpartel/bindfs#132 (comment)

nc is just used as an example (it is installed on macOS out of the box), I observe the same behavior when trying to listen to unix domain socket from Go via net.Listen("unix", path.Join("b/sock")

@slonopotamus
Copy link
Author

See additional details in mpartel/bindfs#132. It looks like fuse-t doesn't forward mknod call to bindfs at all.

@alexfs
Copy link

alexfs commented Jul 12, 2023

bindfs doesn't implement mknod with sock file type.
See https://libfuse.github.io/doxygen/example_2passthrough__helpers_8h_source.html

@slonopotamus
Copy link
Author

slonopotamus commented Jul 12, 2023

Yeah, mknod implementation seems to be incomplete in bindfs, but if I read log in mpartel/bindfs#132 (comment) correctly, fuse-t doesn't even try to call mknod in bindfs?

@alexfs
Copy link

alexfs commented Jul 12, 2023

I will add this functionality in the next version

@slonopotamus
Copy link
Author

I've tried 1.0.24, but it seems that fuse-t still doesn't pass mknod call to binds

Running bindfs -d -f shows that nc -U sock -l produces the following calls:

unique: 50, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 0
getattr /
   unique: 50, success, outsize: 136
unique: 51, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 0
statfs_x /
   unique: 51, success, outsize: 96
unique: 52, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 0
statfs_x /
   unique: 52, success, outsize: 96
unique: 53, opcode: LOOKUP (1), nodeid: 1, insize: 42, pid: 0
LOOKUP /b
getattr /b
   unique: 53, error: -2 (No such file or directory), outsize: 16
unique: 54, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 0
statfs_x /
   unique: 54, success, outsize: 9

@alexfs
Copy link

alexfs commented Jul 13, 2023

bindfs -d -f a b
nc -U -l b/sock1

statfs_x /
unique: 55, success, outsize: 96
unique: 56, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 0
getattr /
unique: 56, success, outsize: 136
unique: 57, opcode: LOOKUP (1), nodeid: 1, insize: 46, pid: 0
LOOKUP /sock1
getattr /sock1
unique: 57, error: -2 (No such file or directory), outsize: 16
unique: 58, opcode: MKNOD (8), nodeid: 1, insize: 62, pid: 0
mknod /sock1 0140755 0x0 umask=0000

@slonopotamus
Copy link
Author

Hmm... Not sure what I did wrong. After retrying, I confirm that mknod is now passed to binds. nc is still unable to create UNIX socket, but as was discussed, this needs to be fixed on binds side. Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants