I have a samba share and it shows a weird filename in windows whenever a file or directory named ends in space or period

If I do

mkdir temp.

will look like TB5AMV~R in windows.

Is there a fix for this?

UPDATE: my config:

# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#======================= Global Settings =====================================

        smb ports = 445
        workgroup = WORKGROUP
        server string =

        # There was a recent security issue in Samba (Feb 5 2010), a claimed
        # zero-day exploit that exploited an insecure default configuration.
        # According to an Ubuntu Forums post on the topic, the "wide links" option
        # now defaults to no.

        follow symlinks = yes
        wide links = yes
        unix extensions = no

        # added by roy for win7 - 2009-09-09
        client ntlmv2 auth = yes

        # added by roy for recycle bin
        vfs object = recycle
        recycle:repository = .RecycleBin
        recycle:keeptree = yes
        recycle:exclude = *.tmp, *~, *.bak

        printcap name = /etc/printcap
        load printers = no

        cups options = raw

        log file = /var/log/samba/%m.log
        max log size = 50

        security = user

        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

        dns proxy = no

#============================ Share Definitions ==============================
   comment = Home Directories
   browseable = yes
   writable = yes

   comment = All Printers
   path = /var/spool/samba
   browseable = no
   guest ok = no
   writable = no
   printable = yes
  • Please post your smb.conf.
    – Sven
    Feb 26 '11 at 10:40

Samba doesn't consider temp. to be a valid DOS filename so it is mangling it as per the name mangling rules which defaults to on. You can turn name mangling off by setting

mangled names = no

in your smb.conf file followed by restarting samba. Name mangling can be specified as a global or service specific parameter.

  • Thanks for the reply, it kinda worked, the directory name does show properly, but now windows explorer won't open the directory named like this. This is the error I get: Location is not available L:\\test. refers to a location that is unavailable. It could be on a hard drive on this computer, or on a network. Check to make sure that the disk is properly inserted, or that you are connected to the Internet or your network, and then try again. If it still cannot be located, the information might have been moved to a different location.
    – Roy Rico
    Mar 4 '11 at 21:08
  • @Roy Rico: Then that's a different question to which the answer is (probably) don't do it. There is a strip dot directive but I don't know if it will do what you want.
    – user9517
    Mar 4 '11 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.