DOS mode bits missing from Folders

Gerald (Jerry) Carter jerry at
Mon Jan 20 18:08:40 GMT 2003

Hash: SHA1

On Tue, 14 Jan 2003, Esh, Andrew wrote:

> I have a question about the following piece of code in HEAD smbd/dosmode.c,
> at line 139:
> 	if (S_ISDIR(sbuf->st_mode))
> 		result = aDIR | (result & aRONLY);
> This causes the DOS mode "HSA" Hidden, System, and Archive bits to be
> stripped off if a folder is being processed. This makes it impossible to
> store these bits on a Samba server. Windows allows them to be stored for
> folders, except for the "S" System bit.
> Why are these bits being stripped off folders?
> Shouldn't it be:
> 	if (S_ISDIR(sbuf->st_mode))
> 		result |= aDIR;
> When I made that change, folders began to retain DOS bits like the ones
> stored on Windows do.

The e(X)exute bits are special on folders.  For example, if you remove the 
archive (user 'x' bit) from a directory, you will not be able to change to
that directory.

The DOS mode bit stuff really needs a better solution.

cheers, jerry
 Hewlett-Packard            -------------------------
 SAMBA Team                 ----------------------
 GnuPG Key                  ----
 ISBN 0-672-32269-2         "SAMS Teach Yourself Samba in 24 Hours" 2ed
 "You can never go home again, Oatman, but I guess you can shop there."  
                            --John Cusack - "Grosse Point Blank" (1997)

Version: GnuPG v1.2.0 (GNU/Linux)
Comment: For info see


More information about the samba-technical mailing list