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

Richard Sharpe realrichardsharpe at gmail.com
Sun Aug 18 10:55:11 MDT 2013


On Tue, Aug 6, 2013 at 11:47 PM, Volker Lendecke
<Volker.Lendecke at sernet.de> wrote:
> On Thu, Jul 11, 2013 at 03:48:19PM -0700, Richard Sharpe wrote:
>> 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.
>
> If I read that correctly, this is at least per share. It
> does not help if you have submounts within a share with
> different behaviour, but it will not globally disable xattrs
> I believe.

Correct. We ran into problems however because we have a snapshot
driver that presents snapshots under the same folder as the share. It
returns ENOTSUP if you try to set an XATTR on a file in the snapshot
file system. (Actually, the VFS does because we don't implement that
function.)

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


More information about the samba-technical mailing list