EA name len must be less than 255 according to MS-FSCC ...

Richard Sharpe realrichardsharpe at gmail.com
Tue Dec 11 11:00:40 MST 2012

Hi folks,

according to [MS-FSCC].pdf section 2.4.15 we have:

EaNameLength (1 byte): An 8-bit unsigned integer that contains the
length, in bytes, of the extended attribute name in the EaName field.
This value MUST NOT include the terminating null character to EaName.

EaName (variable): An array of 8-bit ASCII characters that contains
the extended attribute name followed by a single terminating null
character byte. The EaName MUST be less than 255 characters and MUST
NOT contain any of the following characters:
ASCII values 0x00 - 0x1F, \ / : * ? " < > | , + = [ ] ;

However, in source3/smbd/trans2.c:fill_ea_buffer we have:

        for (p = pdata + 4; ea_list; ea_list = ea_list->next) {
                size_t dos_namelen;
                fstring dos_ea_name;
                push_ascii_fstring(dos_ea_name, ea_list->ea.name);
                dos_namelen = strlen(dos_ea_name);
                if (dos_namelen > 255 || dos_namelen == 0) {

The description in FSCC does seem a little confusing, but one possible
interpretation is that the name, excluding the terminating NULL must
be less than 255 ASCII chars in length. If that were the case, the
test above is wrong.

Does anyone have any examples of long EA names? Is there an easy way
to set EAs from Windows?

Richard Sharpe

More information about the samba-technical mailing list