Linux CIFS filesystem development
 help / color / mirror / Atom feed
* incomplete FIND_FIRST2 response and resulting cifs behavior
@ 2014-12-08  0:59 Michael Kerscher
  0 siblings, 0 replies; only message in thread
From: Michael Kerscher @ 2014-12-08  0:59 UTC (permalink / raw)
  To: Steve French; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA, Maximilian Engelhardt

[-- Attachment #1: Type: text/plain, Size: 1833 bytes --]

Hello,

we found an issue which might be sourced in the cifs module and might
only be triggered in a special case.

Our current situation:
We run a samba-4.1.13 (debian jessie) and in our share are some files
with an iso 8859-1 encoding (e.g. test_ä_foo). There are some errors in
the samba log like

[2014/12/07 20:00:52.353146,  0]
../lib/util/charset/convert_string.c:438(convert_string_talloc_handle)
  Conversion error: Illegal multibyte sequence(ä_foo)

This is an issue I will also look into but the problem is, that samba
responds to the FIND_FIRST2 request with an incomplete response. I
attached a pcap with an example which I logged on my client. The
requested directory (public/mytest) contained only a file named
test_ä_foo (in iso 8859-1 encoding) so the response contained the . and
.. directory entries and a file entry which is missing the file name
field at the end of the packet. It just stops at the num links field.

A windows client just shows an empty filename in the explorer.

If mounted on linux with cifs then I see either random characters, some
directory/file names of the parent directory (or other directories) or
ls: reading directory /mnt/tmp/public/mytest: Invalid argument
On repeated calls of ls the filename changes to some other folder names.

E.g if my directory looks like
-> public
   - test_file
   - test_foo
   -> mytest
      - test_ä_foo
then $ ls public/mytest might have the following outputs:
$ ls public/mytest
<some_random_chars>
$ ls public/mytest
test_file
$ ls public/mytest
test_file
$ ls public/mytest
test_foo

which is not what I expected (test_ä_foo)

In the attached pcap log you can see a request where there should be
included the directory entries ".", ".." and a file named "test_ä_foo".

If you need more details I'll be happy to provide them.

regards,
Michael

[-- Attachment #2: example.pcapng --]
[-- Type: application/octet-stream, Size: 784 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-08  0:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08  0:59 incomplete FIND_FIRST2 response and resulting cifs behavior Michael Kerscher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox