Bug 6775 - Strange behaviour of STORE DOS ATTRIBUTES
Strange behaviour of STORE DOS ATTRIBUTES
Status: NEW
Product: Samba 3.2
Classification: Unclassified
Component: File services
unspecified
All Windows XP
: P3 major
: ---
Assigned To: Volker Lendecke
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-01 07:46 UTC by Hans Lampl
Modified: 2009-11-17 08:36 UTC (History)
0 users

See Also:


Attachments
smb.conf (2.65 KB, text/plain)
2009-10-02 05:05 UTC, Hans Lampl
no flags Details
Level 10 log file (810.52 KB, text/plain)
2009-10-02 05:08 UTC, Hans Lampl
no flags Details
Logfile for dos attribute bug (520.20 KB, text/plain)
2009-11-17 08:34 UTC, Dr. Volker Arendt
no flags Details
smb.conf for samba 3.4.3 (3.70 KB, text/plain)
2009-11-17 08:36 UTC, Dr. Volker Arendt
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Lampl 2009-10-01 07:46:08 UTC
Whereas the behaviour of the parameter "STORE DOS ATTRIBUTES" was working as expected and described in Samba V3.0.x, its behaviour changed in a very strange way with V3.2.x and later. With V3.2.x and later the parameter is ignored (or to be precise deactivated) if the parent directory of the shared directory does not support extended attributes as well. 

The problem comes with the following code (smbd/dosmode.c) that was introduced with V3.2.x:

sizeret = SMB_VFS_GETXATTR(conn, path, SAMBA_XATTR_DOS_ATTRIB, attrstr, sizeof(attrstr));
if (sizeret == -1) {
  if (errno == ENOSYS
#if defined(ENOTSUP)
      || errno == ENOTSUP) {
#else
   ) {
#endif
     DEBUG(1,("get_ea_dos_attributes: Cannot get attribute from EA on file %s: Error = %s\n", path, strerror(errno) ));                                                       
     set_store_dos_attributes(SNUM(conn), False);
   }                                                   
   return False;
}

Since Windows is trying to retrieve the attributes of the parent directory when accessing the shared directory. In this case the SMB_VFS_GETXATTR call returns 95 (ENOTSUP) and the STORE DOS ATTRIBUTES will be disabled.

In V3.0.x that piece of code was completely different:

sizeret = SMB_VFS_GETXATTR(conn, path, SAMBA_XATTR_DOS_ATTRIB, attrstr, sizeof(attrstr));
if (sizeret == -1) {
#if defined(ENOTSUP) && defined(ENOATTR)
  if ((errno != ENOTSUP) && (errno != ENOATTR) && (errno != EACCES) && (errno != EPERM)) {
    DEBUG(1,("get_ea_dos_attributes: Cannot get attribute from EA on file %s: Error = %s\n", path, strerror(errno) ));                                                       
    set_store_dos_attributes(SNUM(conn), False);                                            
  }                                                   
#endif
  return False;
}

When accessing path=./.. the ENOTSUP error is ignored by that code and everthing is working fine.

I guess that the behaviour of V3.2.x (and later) isn't the intended one.

Yours sincerely
Hans Lampl
Comment 1 Jeremy Allison 2009-10-01 14:32:08 UTC
Can you get me a debug level 10 log of this happening please, as well as your smb.conf. I need to see exactly when and why smbd is accessing ../ for a shared directory (it shouldn't be).

Jeremy.
Comment 2 Hans Lampl 2009-10-02 05:05:50 UTC
Created attachment 4775 [details]
smb.conf
Comment 3 Hans Lampl 2009-10-02 05:08:34 UTC
Created attachment 4776 [details]
Level 10 log file

The following actions have been performed:
1.) Start Samba 3.4.1
2.) Open a window with the Windows Explorer to display the shared directory
3.) Stop Samba
Comment 4 Dr. Volker Arendt 2009-11-17 08:34:43 UTC
Created attachment 4955 [details]
Logfile for dos attribute bug
Comment 5 Dr. Volker Arendt 2009-11-17 08:36:08 UTC
Created attachment 4956 [details]
smb.conf for samba 3.4.3