[Samba] user.DOSATTRIB defaults to hidden?

x20120107 at brindabella.org x20120107 at brindabella.org
Wed Jan 11 01:48:35 MST 2012

Hi all,

Is there a way to control the default DOS attributes stored in the 
user.DOSATTRIB value?  I'm using a QNAP NAS device (running Samba) that 
seems to create files that have the 'hidden' DOS attribute set by the 
user.DOSATTRIB value as a default.

The NAS device's smb.conf has the 'store dos attributes' option set to 
yes and each of the 'map hidden', 'map system', 'map archive' and 'map 
readonly' are set to no.  Consequently, the DOS attributes of files are 
controlled by the filesystem extended attribute user.DOSATTRIB, and NOT 
by the executible bits of the files on the NAS.  Changing the DOS 
attributes from a Windows machine does not modify any of the permissions 
(ie. the executable bits) of the files on the NAS device.  However, I 
was able to confirm with the getfattr command on the NAS that the 
user.DOSATTRIB values were changing whenever changes to the DOS 
attributes were made from the Windows machine.

I set this NAS device up recently and rsync'ed my media files to a share 
on it (from a Linux box).  The files themselves had never existed on a 
Windows box.  When browsing the share as guest from a Windows box, none 
of the files were visible (unless 'show hidden files' was enabled on the 
Windows box).  This issue has been bothering many users of the QNAP NAS 
devices as well as users of some other brands too.

When I first copied the files to the NAS, I assume it was Samba that 
would have originally set the user.DOSATTRIB values?  If so, why would 
they be set as 'hidden' by default?

 From a Linux box, I am able to recursively modify the user.DOSATTRIB 
values using smbclient as follows:
cd /mountpoint
find * -type f -exec smbclient -N -c 'setmode "{}" -h' //server/sharename \;

However, it is not clear to me why they would be set to 'hidden' in the 
first place.  If 'store dos attributes' is set to 'yes' in smb.conf, 
does the 'create mask' setting affect the user.DOSATTRIB values?

One other weird thing - if I unset the world readable bit on these files 
(from the NAS box), they are no longer hidden from the point of view of 
the Windows machine (though they are no longer readable).  It seems like 
the permissions are still mapping the DOS attributes in some way even 
though the map hidden option is set to no.  What's weird though is that 
it isn't one of the executable bits as documented in the Samba 
documentation that is modifying the hidden attribute.

Grateful for any insights into these issues.


More information about the samba mailing list