SOLVED Strange totally locked folders in Windows share

Status
Not open for further replies.
Joined
Mar 6, 2014
Messages
686
Hi guys,

I have a Windows share in which i see strange subfolders that i can do totally nothing with, named "BLABLA~1" or similar. If i try to open them from my Windows machine: "Folder not available". If i right-click on them --> properties it tells me it is partially read-only, size is 0 bytes, security tab tells me the privileges are not available or cannot be displayed. If I ssh into my FreeNAS machine and ls -a in the root folder of this share, these strange folders i see from my Windows machine are not displayed.

Any ideas?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Hi guys,

I have a Windows share in which i see strange subfolders that i can do totally nothing with, named "BLABLA~1" or similar. If i try to open them from my Windows machine: "Folder not available". If i right-click on them --> properties it tells me it is partially read-only, size is 0 bytes, security tab tells me the privileges are not available or cannot be displayed. If I ssh into my FreeNAS machine and ls -a in the root folder of this share, these strange folders i see from my Windows machine are not displayed.

Any ideas?
Possibly related to file locking. What client? Post your smb4.conf file (/usr/local/etc/smb4.conf). See if anything appears in /var/log/samba4/log.smbd when you click on one of the folders.
 
Joined
Mar 6, 2014
Messages
686
Relevant smb4.conf blocks:
Code:
[global]
    username map = /usr/local/etc/smbusers
    server min protocol = SMB2
    server max protocol = SMB3_00
    encrypt passwords = yes
    dns proxy = no
    strict locking = no
    oplocks = yes
    deadtime = 15
    max log size = 51200
    max open files = 941798
    load printers = no
    printing = bsd
    printcap name = /dev/null
    disable spoolss = yes
    getwd cache = yes
    guest account = nobody
    map to guest = Bad User
    obey pam restrictions = yes
    directory name cache size = 0
    kernel change notify = no
    dfree command = /usr/local/libexec/samba/dfree
    panic action = /usr/local/libexec/samba/samba-backtrace
    nsupdate command = /usr/local/bin/samba-nsupdate -g
    server string = FreeNAS Server
    ea support = yes
    store dos attributes = yes
    lm announce = yes
    time server = yes
    acl allow execute always = false
    acl check permissions = true
    dos filemode = yes
    multicast dns register = yes
    domain logons = no
    local master = yes
    idmap config *: backend = tdb
    idmap config *: range = 90000001-100000000
    server role = standalone
    netbios name = NAS
    workgroup = WORKGROUP
    security = user
    pid directory = /var/run/samba
    smb passwd file = /var/etc/private/smbpasswd
    private dir = /var/etc/private
    create mask = 0666
    directory mask = 0777
    client ntlmv2 auth = yes
    dos charset = CP437
    unix charset = UTF-8
    log level = 1
    ea support = no
    store dos attributes = no
    map archive = no
    map hidden = no
    map readonly = no
    map system = no

[media]
    path = /mnt/trunk/media
    printable = no
    veto files = /.snapshot/.windows/.mac/.zfs/
    writeable = yes
    browseable = yes
    recycle:repository = .recycle/%U
    recycle:keeptree = yes
    recycle:versions = yes
    recycle:touch = yes
    recycle:directory_mode = 0777
    recycle:subdir_mode = 0700
    vfs objects = zfsacl aio_pthread streams_xattr
    hide dot files = yes
    guest ok = no
    nfs4:mode = special
    nfs4:acedup = merge
    nfs4:chown = true
    zfsacl:acesort = dontcare

Nothing in the logfile when trying to access or delete the folder(s)

EDIT: these strange folders only appear in 1 subfolder in the dataset & share "media".
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Try decreasing "server max protocol" to SMB2. If that doesn't resolve the problem, increase logging verbosity and try to get some sort of information out of samba's log.smbd.
 
Joined
Mar 6, 2014
Messages
686
Try decreasing "server max protocol" to SMB2.
Why would that help?
increase logging verbosity and try to get some sort of information out of samba's log.smbd.
Trying to open the folder on the Win8.1 client results in the following logfile entries:
On loglevel 'normal', i do see some of these, not sure it this has something to do with it:
Code:
[2015/06/24 22:59:44.622419,  2] ../source3/smbd/server.c:419(remove_child_pid
     Could not find child 66034 -- ignoring

Loglevel 'full' and 'debug' are giving me soooooo much information, im still looking into that.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
You know I had some permissions issues when I upgraded recently (Samba 4.2 I think). It drove me nuts and every time I upgrade where there is a Samba related change, it seams like my automated backups start failing consolidation (deletion) because of permission issues. And this doesn't affect all my files, so far only my backups. I'm not making a formal complaint here, just stating that if you recently upgraded, those wonderful new upgrades could be getting you.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
You know I had some permissions issues when I upgraded recently (Samba 4.2 I think). It drove me nuts and every time I upgrade where there is a Samba related change, it seams like my automated backups start failing consolidation (deletion) because of permission issues. And this doesn't affect all my files, so far only my backups. I'm not making a formal complaint here, just stating that if you recently upgraded, those wonderful new upgrades could be getting you.

We're still on 4.1.18. Just wait 4.2.x gets pushed out. Then we'll have fun stomping out brush fires for the next 6 months.
 
Joined
Mar 6, 2014
Messages
686
Fun... Like seeing weird folders just miraculously appearing on just the client side, with the client having no access what soever on them...?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Last edited:
Joined
Mar 6, 2014
Messages
686
I don't see how upper/lower cases (that's the only thing mentioned under 'mangling' in your link) would screw up and do things like in my case. But I shall anyhow look at the differences in folder listings between the windows client en the nas itself besides the obvious. Maybe these folders don't just appear, maybe these are actually some valid folders on my NAS and samba screwing them up.

But I'll do that tomorrow. Have to get up in six hours.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
We're still on 4.1.18. Just wait 4.2.x gets pushed out. Then we'll have fun stomping out brush fires for the next 6 months.
To be honest, I think if Samba gets upgraded again before FreeNAS 10, I'll hold off. It isn't worth the headaches that some of these upgrades can generate.
Have to get up in six hours.
Night Night
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I don't see how upper/lower cases (that's the only thing mentioned under 'mangling' in your link) would screw up and do things like in my case. But I shall anyhow look at the differences in folder listings between the windows client en the nas itself besides the obvious. Maybe these folders don't just appear, maybe these are actually some valid folders on my NAS and samba screwing them up.

But I'll do that tomorrow. Have to get up in six hours.

https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#MANGLEDNAMES
 
Joined
Mar 6, 2014
Messages
686

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Ahhhh that's what you meant! I know about that one. However, these folders appear to have totally random names. No folder that I created starts (1st 5 characters) with random numbers and letters.
But I'll look into this issue again tomorrow. Thanks for the help already guys!

Someone in samba mailing list complained recently about 'name mangling' overly mangling names. https://marc.info/?l=samba&m=142080597605687&w=2

"For example:
if the long file name is LONGFILENAME.TXT, i expect the mangled sholud
be something like LONGF~01.TXT, but i see: LNHQX6~C.TXT"

The user ended up changing to an older version of the hashing algorithm for generating mangled names. That sounds like a bit of an annoyance as the older algorithm is more likely to generate name collisions. Samba might not be interpreting the acls on the 'name mangled' directory correctly and be denying you 'read access' to files inside it. The odd thing about ACLS in samba is that if you entirely lack privileges to something, it just disappears.

If I were you, I'd look for some likely candidates for folders with inordinately long names and try shortening them.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Why on earth are 8.3 filenames still relevant? Why are these being created?

Someone in samba mailing list complained recently about 'name mangling' overly mangling names.
That sounds like the stereotypical Samba problem.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
What is the filename locally on FreeNAS and how does it differ from what is displayed over smb. I have run into similar issues to this when using smb on linux and how linux treats paths and symbols different than how windows treats them.
 
Joined
Mar 6, 2014
Messages
686
Someone in samba mailing list complained recently about 'name mangling' overly mangling names. https://marc.info/?l=samba&m=142080597605687&w=2

"For example:
if the long file name is LONGFILENAME.TXT, i expect the mangled sholud
be something like LONGF~01.TXT, but i see: LNHQX6~C.TXT"
Thanks, looks like my problem exactly! I'll look into that when i get home tonight.
(Your link doesn't work?)

What is the filename locally on FreeNAS and how does it differ from what is displayed over smb.
Yeah, i now have to find out which folders i am missing in the client vs available folders on FreeNAS.

You could probably diff the output of "ls" locally and "ls" through smbclient pointed at localhost.
Ha! Simple solution, me like. However, i'm on a Win8.1 client. Not sure if i can easily diff ls output with dir output. Might copy paste it in some spreadsheet, sort both outputs and compare.
 
Joined
Mar 6, 2014
Messages
686
Found it! Folders with a ':' in it get TOTALLY screwed up by Samba!
Removed the ':' in all folders that contained one and everything works fine now :)
 
Status
Not open for further replies.
Top