DOS mode bits missing from Folders

Esh, Andrew AEsh at
Tue Jan 14 23:46:06 GMT 2003

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.

Andrew C. Esh                mail:Andrew_Esh at
Adaptec, Inc.
2905 Northwest Blvd., Suite 20        763-557-9005 (main)
Plymouth, MN 55441-2644 USA      763-551-6418 (direct)

-------------- next part --------------
HTML attachment scrubbed and removed

More information about the samba-technical mailing list