cifs.mount: mapchars + utf8 = loop

Bug #260396 reported by staho on 2008-08-22
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
samba
In Progress
Medium
cifs-utils (Ubuntu)
Low
Chuck Short

Bug Description

Binary package hint: samba

Mounting a SMB share with option "mapchars" gives odd effects with folder names with non-ascii characters, eg. Polish national ones (ąćęłńóśźż): the only contents of such a folder is the same folder itself.

good (without mapchars):
$ sudo mount -t cifs //win2003server/whatever whatever -o credentials=/secret,iocharset=utf8
$ ls whatever
sprzęt
$ ls whatever/sprzęt
file1 file2

wrong (with):
$ sudo mount -t cifs //win2003server/whatever whatever -o credentials=/secret,iocharset=utf8,mapchars
$ ls whatever
sprzęt
$ ls whatever/sprzęt
sprzęt
$ ls -l whatever/sprzęt/sprzęt
ls: cannot access whatever/sprzęt/sprzęt: No such file or directory

in both cases:
$ env |grep LANG
LANG=pl_PL.UTF-8
GDM_LANG=pl_PL.UTF-8
$ uname -a
Linux lapsus 2.6.26-5-generic #1 SMP Fri Aug 15 13:54:58 UTC 2008 i686 GNU/Linux

Ubuntu 8.10 desktop, upgraded daily.

Jaime Frutos Morales (acidborg) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Unfortunately we can't fix it without more information.

Please include the information requested at https://wiki.ubuntu.com/DebuggingSamba#samba-client.

Changed in samba:
assignee: nobody → acidborg
status: New → Incomplete
assignee: acidborg → nobody
staho (staho) wrote :

OK, I follow the “Samba as a client” query:

• Is it a regression ?
I don't know, sorry.

• What version of samba packages are used ?

⚪ dpkg-query -W -f='${Package} ${Version} ${Source} ${Status}\n' | grep samba
libpam-smbpass 2:3.2.3-1ubuntu3.4 samba install ok installed
libsmbclient 2:3.2.3-1ubuntu3.4 samba install ok installed
libwbclient0 2:3.2.3-1ubuntu3.4 samba install ok installed
samba 2:3.2.3-1ubuntu3.4 install ok installed
samba-common 2:3.2.3-1ubuntu3.4 samba install ok installed
samba-doc 2:3.2.3-1ubuntu3.4 samba install ok installed
smbclient 2:3.2.3-1ubuntu3.4 samba install ok installed
smbfs 2:3.2.3-1ubuntu3.4 samba install ok installed
swat 2:3.2.3-1ubuntu3.4 samba install ok installed
winbind 2:3.2.3-1ubuntu3.4 samba install ok installed

• How is the remote share accessed from the Ubuntu system?
3. cifs filesystem mount (from /etc/fstab or a mount command)

• If nautilus (or another GUI client) is used to access the remote share (...)
N/A

• If a cifs mount is used
⚪ the command line used to mount the remote share if the share is manually mounted — see above
⚪ the content of the file /proc/fs/cifs/DebugData:

Display Internal CIFS Data Structures for Debugging
---------------------------------------------------
CIFS Version 1.54
Active VFS Requests: 0
Servers:
1) Name: 10.0.0.3 Domain: SZPITAL Uses: 1 OS: Windows Server 2003 R2 3790 Dodatek Service Pack 2
 NOS: Windows Server 2003 R2 5.2 Capability: 0x1f3fd
 SMB session status: 1 TCP status: 1
 Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
 Shares:
 1) \\serwer2003\homes Mounts: 1 Type: NTFS DevInfo: 0x20 Attributes: 0x700ff
PathComponentMax: 255 Status: 0x1 type: DISK

 MIDs:

• What is the remote server ?

⚪ smbclient -L //serwer2003
Enter staho's password:
Domain=[SERWER2003] OS=[Windows Server 2003 R2 3790 Dodatek Service Pack 2] Server=[Windows Server 2003 R2 5.2]

 Sharename Type Comment
 --------- ---- -------
 magazyn Disk
 propublico Disk
 C$ Disk Domyślny udział
 homes Disk
 byleco Disk
 rozliczenia Disk
 kopie Disk
 IPC$ IPC Zdalne wywołanie IPC
 grupy Disk
 ADMIN$ Disk Administracja zdalna
 D$ Disk Domyślny udział
Domain=[SERWER2003] OS=[Windows Server 2003 R2 3790 Dodatek Service Pack 2] Server=[Windows Server 2003 R2 5.2]

 Server Comment
 --------- -------

 Workgroup Master
 --------- -------

⚪ Also include on what kind of machine the share is located:
Windows 2003 Server

Thierry Carrez (ttx) wrote :

staho: Thanks for all the information. In order to narrow the issue down, would you have the opportunity to test with Jaunty (for example from an alpha6 liveCD) to see if the issue got solved in the 3.3.x Samba version ? Thanks in advance !

staho (staho) wrote :

Here you are -- client is JauntyJ, updated daily:

$ sudo mount -t cifs //serwer2003/homes whatever -o credentials=/secret,iocharset=utf8,mapchars
$ ls whatever/staho/źdźbło/
źdźbło
$ ls whatever/staho/źdźbło/źdźbło/
ls: nie ma dostępu do whatever/staho/źdźbło/źdźbło/: No such file or directory

$ dpkg-query -W -f='${Package} ${Version} ${Source} ${Status}\n' | grep samba
libsmbclient 2:3.3.1-1ubuntu1 samba install ok installed
libwbclient0 2:3.3.1-1ubuntu1 samba install ok installed
samba 2:3.3.1-1ubuntu1 install ok installed
samba-common 2:3.3.1-1ubuntu1 samba install ok installed
smbclient 2:3.3.1-1ubuntu1 samba install ok installed
smbfs 2:3.3.1-1ubuntu1 samba install ok installed
winbind 2:3.3.1-1ubuntu1 samba install ok installed

$ cat /proc/fs/cifs/DebugData
Display Internal CIFS Data Structures for Debugging
---------------------------------------------------
CIFS Version 1.55
Active VFS Requests: 0
Servers:
1) Name: 10.0.0.3 Domain: SZPITAL Uses: 1 OS: Windows Server 2003 R2 3790 Dodatek Service Pack 2
 NOS: Windows Server 2003 R2 5.2 Capability: 0x1f3fd
 SMB session status: 1 TCP status: 1
 Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
 Shares:
 1) \\serwer2003\homes Mounts: 1 Type: NTFS DevInfo: 0x20 Attributes: 0x700ff
PathComponentMax: 255 Status: 0x1 type: DISK

 MIDs:

Thierry Carrez (ttx) on 2009-03-16
Changed in samba:
status: Incomplete → New
Thierry Carrez (ttx) wrote :

Would this happen to be a Windows 2003 Server DFS share ? This looks a lot like bug 134080.

Changed in samba:
status: New → Incomplete
staho (staho) wrote :

Is is just NTFS, not a distributed filesystem.

Thierry Carrez (ttx) on 2009-03-27
Changed in samba:
status: Incomplete → New
Chuck Short (zulcss) wrote :

Thank you for your bug report. This bug has been reported to the developers of the software. You can track it and make comments at:

https://bugzilla.samba.org/show_bug.cgi?id=6767

Changed in samba (Ubuntu):
assignee: nobody → Chuck Short (zulcss)
status: New → Triaged
Changed in samba:
status: Unknown → Confirmed
Chuck Short (zulcss) on 2009-10-06
Changed in samba (Ubuntu):
importance: Undecided → Low
Changed in samba:
status: Confirmed → In Progress
Chuck Short (zulcss) wrote :

Hi,

Can you retry this on karmic?

Thanks
chuck

Paillomams (aymeric-pallottini) wrote :

This issue is still present in karmic. Mount a cifs volume with mapchars an utf8 as option. Create a folder with a name that has a character that include an accent (ex:Vidéos). Then create a folder or a file inside this one close the nautilus window and try to access the newly create file or folder. They won't be there. It is also not possible to delete the folder (or a file) with a name containing an accent.

Changed in samba:
status: In Progress → Invalid
staho (staho) wrote :

Why "Invalid" ?! The bug is still there, as of Ubuntu 10.4 with updates for today.

Chuck Short (zulcss) wrote :

Please supply the information in the samba bug report then.

thanks
chuck

Changed in samba:
status: Invalid → Confirmed
Changed in samba:
status: Confirmed → In Progress
Jelmer Vernooij (jelmer) on 2011-01-02
affects: samba (Ubuntu) → cifs-utils (Ubuntu)
Changed in samba:
importance: Unknown → Medium

I've debugged it, and found the bug, just posted the patch to https://bugzilla.samba.org/show_bug.cgi?id=6767 . It is a one-liner, in cifsConvertToUCS the return statement is incorrect:

--- orig/linux-2.6.32/fs/cifs/misc.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32/fs/cifs/misc.c 2011-10-09 22:25:10.767951322 +0200
@@ -713,7 +713,7 @@
     }

 ctoUCS_out:
- return i;
+ return j;
 }

 void

Best,
Baldvin

Closing after confirming that it's been fixed.

Changed in cifs-utils (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.