Pages

Friday, April 14, 2017

How to access files with colon (:) in filename using Samba

I had a long standing problem. Samba would convert filenames with colon (:) to unrecognizable names. For example name Filename Date:Time.mkv could be converted into C7MXR~1.mkv

Some people seem to have success by using:
        mangled names = no
However this setting allowed me to see the files but I got access errors when trying to access them from computers which use Windows. This seems to be a bug in Samba causing the problem when accessing files with colon (:) in their names.

I solved the issue partially by converting the colon (:) into tilde (~). You can convert it to anything you want. This way, there is also no reason to disable `mangled names` option in `smb.conf` because Samba does not try to mangle names if there are no restricted characters.
        vfs objects = catia
        catia:mappings = 0x3a:0x7e
After this setting, the file Filename Date:Time.mkv appears as Filename Date~Time.mkv and it is possible to access the file from Windows based workstations without any problems.

For this to work, you need the catia module installed. For example in Ubuntu this requires samba-vfs-modules package to be installed on your system.

2 comments:

  1. Drive-by THANK YOU! I did not know about the catia module.

    ReplyDelete
  2. I am happy to see that this helped somebody :)

    ReplyDelete