Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

[solved] samba shares and character set?

Got problems with your B2 or B3? Share and get helped!
Post Reply
ingo2
Posts: 81
Joined: 06 Feb 2012, 10:32

[solved] samba shares and character set?

Post by ingo2 »

When uploading some files to B3 on samba-shares I got errors about some file(name)s. Also some filenames were "scrambled". Uploading via SFTP of the same files is ok and verify via md5sum as well.
It seems to me there is a problem with character set.

all client PC's and B3 run Linux. Checked in smb.conf and did not find any entries on

Code: Select all

display charset
unix charset
While 'unix charset' should be UTF8 by default (man page), 'display charset' is "LOCALE" by default.
On B3 here I get:

Code: Select all

ingo@b3:~$ locale
LANG=de_DE.utf8
LC_CTYPE="de_DE.utf8"
LC_NUMERIC="de_DE.utf8"
LC_TIME="de_DE.utf8"
LC_COLLATE="de_DE.utf8"
LC_MONETARY="de_DE.utf8"
LC_MESSAGES="de_DE.utf8"
LC_PAPER="de_DE.utf8"
LC_NAME="de_DE.utf8"
LC_ADDRESS="de_DE.utf8"
LC_TELEPHONE="de_DE.utf8"
LC_MEASUREMENT="de_DE.utf8"
LC_IDENTIFICATION="de_DE.utf8"
LC_ALL=
Is there probably any restriction special to samba regarding "allowed characters" in samba generally? (Linux just excludes "/").
One character which leads to mangling of filenames is "?"

Kind regards,
Ingo
Last edited by ingo2 on 24 Feb 2012, 14:53, edited 1 time in total.
UNIX is user friendly, it's just picky about who its friends are.
ingo2
Posts: 81
Joined: 06 Feb 2012, 10:32

Re: samba shares and character set?

Post by ingo2 »

I now tried to add to smb.conf im [global section]:

Code: Select all

mangled names=no
but that just suppresses of those files, they just don't show up at all.

Does nobody have a solution, I now found out that also the ":" (colon) causes filnames to be mangled :-(
Or do I search in the wrong place: what is mangled is the filename displayed in Nautilus. When opening that file in Totem (to play it), the name shows up correctly!

Kind regards,
Ingo
UNIX is user friendly, it's just picky about who its friends are.
RandomUsername
Posts: 904
Joined: 09 Oct 2009, 18:49

Re: samba shares and character set?

Post by RandomUsername »

Well you don't appear to have given any examples of characters you're having problems with (apart from colons) but my first guess would be that this is a feature of samba. Don't forget, samba has its roots in smb - a Windows protocol. Windows is considerably stricter with characters in file names than *nix.
Last edited by RandomUsername on 31 Jan 2013, 10:31, edited 1 time in total.
ingo2
Posts: 81
Joined: 06 Feb 2012, 10:32

Re: samba shares and character set?

Post by ingo2 »

Thanks for your reply,
following characters (don't know whether tere are more) lead to mangled filenames displayed:

Code: Select all

? : "
One example filename -> displayed as:

Code: Select all

What do I Tell My Heart?.mp3	-> 0NFH8Y~B.MP3
What do You Say?.mp3		-> 0MWYMK~B.MP3
Please note: the filenames are correct on the B3 (uploaded via FTP and double checkt via SSH)!
So it's just how samba handles those filenames (mangled to 8.3 charachters) or how nautilus (GVVS) displays them. Copying those files via samba fails with error. There is no Win$ involved, all Linux systems here.

Kind regards,
Ingo
UNIX is user friendly, it's just picky about who its friends are.
RandomUsername
Posts: 904
Joined: 09 Oct 2009, 18:49

Re: samba shares and character set?

Post by RandomUsername »

I think you need to re-read what I said. To put it another way, as samba is based on smb which originated from Windows, I imagine samba adheres to the same rules for filenames as Windows does. However, I'm finding it quite hard to actually verify that information. Best link I've found so far:

http://fixunix.com/smb/62797-special-ch ... names.html
ingo2
Posts: 81
Joined: 06 Feb 2012, 10:32

Re: samba shares and character set?

Post by ingo2 »

RandomUsername wrote:I think you need to re-read what I said. To put it another way, as samba is based on smb which originated from Windows, I imagine samba adheres to the same rules for filenames as Windows does. However, I'm finding it quite hard to actually verify that information. Best link I've found so far:

http://fixunix.com/smb/62797-special-ch ... names.html
Ok, that sounds reasonable. So also in Linux they have implemented the deficiencies of NTFS and FAT - sad :cry:
In fact it is really difficult to find some information on that, did query Google for hours. I must admit that I do have almost no experience with CIFS and thus samba.

I think the best way for me to solve that problems is to discard/disable samba and set up solid NFSv4 exports on the B3. There is much less overhead, it is stable and faster - and sooo simple to configure. It does not compare to old NFSv3. On my old NAS (Marvell-Orion SoC, Lenny-armel) NFSv4 works absolutely reliable since years now.

Kind regards,
Ingo

P.S.: I do hope that printing support on the B3 uses cups with IPP and not samba?
Last edited by ingo2 on 23 Feb 2012, 16:37, edited 1 time in total.
UNIX is user friendly, it's just picky about who its friends are.
RandomUsername
Posts: 904
Joined: 09 Oct 2009, 18:49

Re: samba shares and character set?

Post by RandomUsername »

ingo2 wrote:Ok, that sounds reasonable. So also in Linux they have implemented the deficiencies of NTFS and FAT - sad :cry:
Not exactly. Samba is not Linux, but is a cross-platform suite of programs.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: samba shares and character set?

Post by Ubi »

If you think this is an annoying feat of cross-compatibility with samba, try changing permissions on the default group from a windows client when ACL is enabled :). THe reality is that windows and posix are a world apart and samba does a great job of trying to bridge it. By definition it is impossible to ever succeed completely.
Gordon
Posts: 1470
Joined: 10 Aug 2011, 03:18

Re: samba shares and character set?

Post by Gordon »

Well now the thing is that the SMB protocol does not include a way of telling what type of operating system is on the other end. In fact it can't even distinguish between different versions of Windows, with the older non-NT type Windows using codepage character sets during transmission and the current ones using unicode. So yes: you should expect Samba not to send file names that the client probably can't handle, even if you have a client that can. Call it the nature of the beast - blame Bill :wink:
ingo2
Posts: 81
Joined: 06 Feb 2012, 10:32

Re: samba shares and character set?

Post by ingo2 »

Sorry, I have to correct myself!

Blaming samba was the wrong address, I have to blame Gnome-VFS instead!

Up to now I always used Nautilus to access the samba shares. Nautilus uses GVFS and libsmbclient to handle samba shares and GVFS does not support "unix extensions". What I now did:

on the B3: add a line to /etc/samba/smb.conf to enable the UNIX-extensions:

Code: Select all

unix extensions=yes
On the Linux-clients:
install cifs-utils and use normal mount with option -t cifs to mount the samba share

With this method of access all filenames are displayed correctly on the command line and also in applications. I even can create files and directories with lot of those "forbidden characters" , see here in /home/storage:

Code: Select all

drwxrwsrwx 2 nobody users 0 24. Feb 14:31 5%?:
-rwxrwxrwx 1 nobody users 0 24. Feb 14:31 ?:xx"
Conclusion: CIFS supports the unix extensions and thus resolves the limitations. However this way is no longer as comfortable as access via GVFS and you have to mount manually or via /etc/fstab.

BTW: I never blamed B3 for that, was just searching for a solution, because those filenames were created automatically by CDDB when ripping my CD's and converting to MP3. With 100's of files ind many subdirectories renaming/converting files was not acceptable.

King regards,
Ingo

EDIT: here a good documentation on CIFS: http://pserver.samba.org/samba/ftp/cifs ... -guide.pdf
UNIX is user friendly, it's just picky about who its friends are.
Post Reply