smbd: do not disable "store dos attributes" on-the-fly
authorUri Simchoni <uri@samba.org>
Thu, 24 Dec 2015 06:10:11 +0000 (08:10 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 25 Dec 2015 12:20:58 +0000 (13:20 +0100)
Smbd would disable "store dos attributes" on-the-fly if the
attempt to set/get user.DOSATTRIB fails with ENOTSUP or ENOSYS.
The rationale behind it was that the file system does not support
extended attributes, so there's no need to fill up the log with
failure messages.

However, a "wide symlink" could point to a spot that doesn't support
extended attributes. Even with the default banned wide links, we
currenly allow stat'ing those files and follow the symlink, and this
in turn would disable "store dos attributes" for the whole share.
The user.DOSATTRIB attribute also stores file creation time,
so that is also affected.

Another case where this behavior would turn storage of DOS attributes
off is that of the ".." entry at the root of the share, if the parent
folder for the share's root path does not support extended attributes.

On the other hand, the information on the file system and its support
of extended attributes is readily available, so the fix for explosion
of the log should be not to configure "store dos attributes" on
such a share.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11649

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Dec 25 13:20:58 CET 2015 on sn-devel-144

source3/include/proto.h
source3/param/loadparm.c
source3/smbd/dosmode.c

index 4cd69fd451a958971e388694b0afdbf517a5a8d9..cc00a84f0f65b208c98d49e5ee3955220766ca03 100644 (file)
@@ -1067,7 +1067,6 @@ uint32_t lp_get_spoolss_state( void );
 struct smb_signing_state;
 bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state);
 void set_use_sendfile(int snum, bool val);
-void set_store_dos_attributes(int snum, bool val);
 void lp_set_mangling_method(const char *new_method);
 bool lp_posix_pathnames(void);
 void lp_set_posix_pathnames(void);
index 348298d4aba457d62b351e59df3d3e7c5c145ace..9f4a2b406401580805a21b1e3ec2078757524a30 100644 (file)
@@ -4262,17 +4262,6 @@ void set_use_sendfile(int snum, bool val)
                sDefault._use_sendfile = val;
 }
 
-/*******************************************************************
- Turn off storing DOS attributes if this share doesn't support it.
-********************************************************************/
-
-void set_store_dos_attributes(int snum, bool val)
-{
-       if (!LP_SNUM_OK(snum))
-               return;
-       ServicePtrs[(snum)]->store_dos_attributes = val;
-}
-
 void lp_set_mangling_method(const char *new_method)
 {
        lpcfg_string_set(Globals.ctx, &Globals.mangling_method, new_method);
index 099600793203b4de978fde039cc21a5c4c258226..942d2869148f7afb0bca69800a6f8509629e45c5 100644 (file)
@@ -279,18 +279,9 @@ static bool get_ea_dos_attribute(connection_struct *conn,
                                   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_attribute: Cannot get attribute "
-                                "from EA on file %s: Error = %s\n",
-                                smb_fname_str_dbg(smb_fname),
-                                strerror(errno)));
-                       set_store_dos_attributes(SNUM(conn), False);
-               }
+               DBG_INFO("get_ea_dos_attribute: Cannot get attribute "
+                        "from EA on file %s: Error = %s\n",
+                        smb_fname_str_dbg(smb_fname), strerror(errno));
                return False;
        }
 
@@ -422,18 +413,9 @@ static bool set_ea_dos_attribute(connection_struct *conn,
                files_struct *fsp = NULL;
 
                if((errno != EPERM) && (errno != EACCES)) {
-                       if (errno == ENOSYS
-#if defined(ENOTSUP)
-                               || errno == ENOTSUP) {
-#else
-                               ) {
-#endif
-                               DEBUG(1,("set_ea_dos_attributes: Cannot set "
-                                        "attribute EA on file %s: Error = %s\n",
-                                        smb_fname_str_dbg(smb_fname),
-                                        strerror(errno) ));
-                               set_store_dos_attributes(SNUM(conn), False);
-                       }
+                       DBG_INFO("set_ea_dos_attributes: Cannot set "
+                                "attribute EA on file %s: Error = %s\n",
+                                smb_fname_str_dbg(smb_fname), strerror(errno));
                        return false;
                }