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

Problem with samba share folders (jnr-fuse + winfsp) #129

Open
evial opened this issue Jun 22, 2021 · 2 comments
Open

Problem with samba share folders (jnr-fuse + winfsp) #129

evial opened this issue Jun 22, 2021 · 2 comments

Comments

@evial
Copy link

evial commented Jun 22, 2021

Hi,

We use jnr-fuse on Windows with winfsp for a cloud storage application. Everything works great locally, files can be accessed normally from our mount-point but we're facing a problem when we configure a Samba folder within the mount-point to share the files with other computers. From a Linux SMB client, it works properly but from Windows clients, we have a "directory name is invalid" error when we try to open a file. There's nothing strange in the fuse debug. When opening the file on the client, the open method is called in the FuseStub but for some reasons, the read request is never sent through the SMB protocol. It seems there's something wrong with the open result, maybe winfsp is expecting some information we don't provide with. I know the problem description is vague but do you have any idea what coud cause this issue? Could it be connected with the FuseFileInfo structure? We just set the file handler "fi.fh.set(handler)", nothing more. Any help would be appreciated.

Thanks

@SerCeMan
Copy link
Owner

Hey, @evial! I think enabling debugging logs might help to understand the issue, you can find an example here (last argument):

stub.mount(Paths.get(path), true, true);

@evial
Copy link
Author

evial commented Jun 22, 2021

Thanks @SerCeMan for the tip. Actually, I had already enabled the fuse debug but I didn't find anything relevant. Below the output when opening the file "hot/test/hello.txt" in the shared folder:

java[TID=5194]: FFFFC108A4617630: >>Create [KT---C] "\hot\test", FILE_OPEN, CreateOptions=1, FileAttributes=10, Security=NULL, AllocationSize=0:0, AccessToken=0000000000001DC8[PID=4], DesiredAccess=a0, GrantedAccess=0, ShareAccess=3
java[TID=5194]: FFFFC108A4617630: <<Create IoStatus=0[1] UserContext=0000000000000000:0000027D72A73A20, GrantedAccess=a0, FileInfo={FileAttributes=10, ReparseTag=0, AllocationSize=0:0, FileSize=0:0, CreationTime=2021-06-21T09:05:53.000Z, LastAccessTime=2021-06-21T09:05:53.000Z, LastWriteTime=2021-06-21T09:05:53.000Z, ChangeTime=2021-06-21T09:05:53.000Z, IndexNumber=0:0}
java[TID=5194]: FFFFC108A4615690: >>Create [UT---C] "\hot\test", FILE_OPEN, CreateOptions=100, FileAttributes=0, Security=NULL, AllocationSize=0:0, AccessToken=0000000000001F8C[PID=4], DesiredAccess=100080, GrantedAccess=0, ShareAccess=7
java[TID=5194]: FFFFC108A4615690: <<Create IoStatus=0[1] UserContext=0000000000000000:0000027D72A73810, GrantedAccess=100080, FileInfo={FileAttributes=10, ReparseTag=0, AllocationSize=0:0, FileSize=0:0, CreationTime=2021-06-21T09:05:53.000Z, LastAccessTime=2021-06-21T09:05:53.000Z, LastWriteTime=2021-06-21T09:05:53.000Z, ChangeTime=2021-06-21T09:05:53.000Z, IndexNumber=0:0}
java[TID=5194]: FFFFC108A4617630: >>QuerySecurity 0000000000000000:0000027D72A73810
java[TID=5194]: FFFFC108A4617630: <<QuerySecurity IoStatus=0[0] Security="O:WDG:WDD:P(A;;FA;;;WD)(A;;0x1201ef;;;WD)(A;;0x1201ef;;;WD)"
java[TID=5194]: FFFFC108A4629A00: >>Close 0000000000000000:0000027D72A73810
java[TID=5194]: FFFFC108A4629A00: <<Close IoStatus=0[0]
java[TID=5194]: FFFFC108A5B463D0: >>Create [UT---C] "\hot\test\hello.txt", FILE_OPEN, CreateOptions=200100, FileAttributes=0, Security=NULL, AllocationSize=0:0, AccessToken=0000000000001F64[PID=4], DesiredAccess=80, GrantedAccess=0, ShareAccess=7
java[TID=5194]: FFFFC108A5B463D0: <<Create IoStatus=0[1] UserContext=0000000000000000:0000027D72A738D0, GrantedAccess=80, FileInfo={FileAttributes=0, ReparseTag=0, AllocationSize=0:1000, FileSize=0:24, CreationTime=2021-06-21T09:06:15.000Z, LastAccessTime=2021-06-21T09:06:15.000Z, LastWriteTime=2021-06-21T18:02:16.000Z, ChangeTime=2021-06-21T09:06:15.000Z, IndexNumber=0:0}
java[TID=5194]: FFFFC108A5B463D0: >>QuerySecurity 0000000000000000:0000027D72A738D0
java[TID=5194]: FFFFC108A5B463D0: <<QuerySecurity IoStatus=0[0] Security="O:WDG:WDD:P(A;;0x1f01bf;;;WD)(A;;0x1201af;;;WD)(A;;0x1201af;;;WD)"
java[TID=5194]: FFFFC108A46330F0: >>Close 0000000000000000:0000027D72A738D0
java[TID=5194]: FFFFC108A46330F0: <<Close IoStatus=0[0]
java[TID=5194]: FFFFC108A4620760: >>Create [UT---C] "\hot\test\hello.txt", FILE_OPEN, CreateOptions=140, FileAttributes=0, Security=NULL, AllocationSize=0:0, AccessToken=0000000000001F88[PID=4], DesiredAccess=120089, GrantedAccess=0, ShareAccess=7
java[TID=5194]: FFFFC108A4620760: <<Create IoStatus=0[1] UserContext=0000000000000000:0000027D72A73360, GrantedAccess=120089, FileInfo={FileAttributes=0, ReparseTag=0, AllocationSize=0:1000, FileSize=0:24, CreationTime=2021-06-21T09:06:15.000Z, LastAccessTime=2021-06-21T09:06:15.000Z, LastWriteTime=2021-06-21T18:02:16.000Z, ChangeTime=2021-06-21T09:06:15.000Z, IndexNumber=0:0}
java[TID=5194]: FFFFC108A5B463D0: >>QuerySecurity 0000000000000000:0000027D72A73360
java[TID=5194]: FFFFC108A5B463D0: <<QuerySecurity IoStatus=0[0] Security="O:WDG:WDD:P(A;;0x1f01bf;;;WD)(A;;0x1201af;;;WD)(A;;0x1201af;;;WD)"
java[TID=5194]: FFFFC10899BFDA70: >>Read 0000000000000000:0000027D72A73360, Address=0000027D7AD70000, Offset=0:0, Length=4096, Key=0
java[TID=5194]: FFFFC10899BFDA70: <<Read IoStatus=0[36]

The read method is called at the end but no SMB read request is issued by the client (cannot see any in Wireshark) so I think this read is not aimed to return the file content. Anyway, no content data is sent back to the client before it shows the error message. Compared with the debug from a successfull read (from a Linux SMB client), the only difference I noticed is the value of the ShareAccess field in the FILE_OPEN: ShareAccess=7 (fail) vs ShareAccess=3 (success). I have no idea what it means.

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