You are not logged in.

#1 2024-10-01 15:08:04

prchad
Member
Registered: 2024-10-01
Posts: 2

Samba hidden file status with Windows

Hi, I'm new here and new to Linux in general.

My Samba sharing seems basically functional. I'm wondering if it's possible to set things up so that a Windows user can mark a file/folder as hidden, and the marked file/folder remains hidden to Windows? (It can be hidden or not for Linux.)

I tried mapping hidden in smb.conf, but on the Windows side it keeps telling me it's not supported by server.

Thanks for any help.

Offline

#2 2024-10-01 15:44:01

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,805

Re: Samba hidden file status with Windows

I tried mapping hidden in smb.conf, but on the Windows side it keeps telling me it's not supported by server.

Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855

https://man.archlinux.org/man/smb.conf.5

map hidden (S)

This controls whether DOS style hidden files should be mapped to the UNIX world execute bit.
Note that this parameter will be ignored if the store dos attributes parameter is set, as the DOS hidden attribute will then be stored inside a UNIX extended attribute.

Note that this requires the create mask to be set such that the world execute bit is not masked out (i.e. it must include 001). See the parameter create mask for details.

Default: map hidden = no

store dos attributes (S)

If this parameter is set Samba attempts to first read DOS attributes (SYSTEM, HIDDEN, ARCHIVE or READ-ONLY) from a filesystem extended attribute, before mapping DOS attributes to UNIX permission bits (such as occurs with map hidden and map readonly). When set, DOS attributes will be stored onto an extended attribute in the UNIX filesystem, associated with the file or directory. When this parameter is set it will override the parameters map hidden, map system, map archive and map readonly and they will behave as if they were set to off. This parameter writes the DOS attributes as a string into the extended attribute named "user.DOSATTRIB". This extended attribute is explicitly hidden from smbd clients requesting an EA list. On Linux the filesystem must have been mounted with the mount option user_xattr in order for extended attributes to work, also extended attributes must be compiled into the Linux kernel. In Samba 3.5.0 and above the "user.DOSATTRIB" extended attribute has been extended to store the create time for a file as well as the DOS attributes. This is done in a backwards compatible way so files created by Samba 3.5.0 and above can still have the DOS attribute read from this extended attribute by earlier versions of Samba, but they will not be able to read the create time stored there. Storing the create time separately from the normal filesystem meta-data allows Samba to faithfully reproduce NTFS semantics on top of a POSIX filesystem. The default has changed to yes in Samba release 4.9.0 and above to allow better Windows fileserver compatibility in a default install.
Default: store dos attributes = yes

Offline

#3 2024-10-02 04:21:45

prchad
Member
Registered: 2024-10-01
Posts: 2

Re: Samba hidden file status with Windows

Thanks for your help.

When I wake up and open my Windows machine this morning, a Windows update broke my network driver, so I'm not able to test if the change in configuration works as I expect right now. Troubleshooting that problem would be out of scope of this forum though.

I'll try to capture the error message if it still shows up.

Offline

Board footer

Powered by FluxBB