dosmode.c:get_ea_dos_attributes switches off lp_store_dos_attributes in cases when it shouldn't

Richard Sharpe realrichardsharpe at gmail.com
Thu Jul 11 16:48:19 MDT 2013


Hi folks,

In source3/smbd/dosmode.c:get_ea_dos_attributes we see this:

        if (!lp_store_dos_attributes(SNUM(conn))) {
                return False;
        }

        /* Don't reset pattr to zero as we may already have
filename-based attributes we
           need to preserve. */

        sizeret = SMB_VFS_GETXATTR(conn, smb_fname->base_name,
                                   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);
                }
                return False;
        }

Imagine if you will Samba running on a system with multiple file
systems all of which have shares on them. If one of those file systems
does not support XATTRs, and we stumble across it, we will switch off
DOS attributes in XATTRs for all of them and the user will be
scratching his head about why DOS attributes no longer works
sometimes.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)


More information about the samba-technical mailing list