Compartir a través de


2.2.1.2.2 SMB_FEA

The SMB_FEA data structure is used in Transaction2 subcommands and in the NT_TRANSACT_CREATE subcommand to encode an extended attribute (EA) name/value pair. "FEA" stands for "full extended attribute".<12>

 SMB_FEA
    {
    UCHAR      ExtendedAttributeFlag;
    UCHAR      AttributeNameLengthInBytes;
    USHORT     AttributeValueLengthInBytes;
    UCHAR      AttributeName[AttributeNameLengthInBytes + 1];
    UCHAR      AttributeValue[AttributeValueLengthInBytes];
    }


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

ExtendedAttributeFlag

AttributeNameLengthInBytes

AttributeValueLengthInBytes

AttributeName (variable)

...

AttributeValue (variable)

...

ExtendedAttributeFlag (1 byte): This is a bit field. Only the 0x80 bit is defined.

Name and Bitmask

Meaning

0x7F

Reserved.

FILE_NEED_EA

0x80

If set (1), this bit indicates that extended attribute (EA) support is required on this file. Otherwise, EA support is not required. If this flag is set, the file to which the EA belongs cannot be properly interpreted without understanding the associated extended attributes.

A CIFS client that supports EAs can set this bit when adding an EA to a file residing on a server that also supports EAs. The server MUST NOT allow this bit to be set on an EA associated with directories.

If this bit is set on any EA associated with a file on the server, the server MUST reject client requests to open the file (except to truncate the file) if the SMB_FLAGS2_EAS flag is not set in the request header. In this case, the server SHOULD fail this request with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) in the Status field of the SMB Header (section 2.2.3.1) in the server response.

AttributeNameLengthInBytes (1 byte): This field MUST contain the length, in bytes, of the AttributeName field (excluding the trailing null byte).

AttributeValueLengthInBytes (2 bytes): This field MUST contain the length, in bytes, of the AttributeValue field.

AttributeName (variable): This field contains the name, in extended ASCII (OEM) characters, of an extended attribute. The length of the name MUST NOT exceed 255 bytes. An additional byte is added to store a null padding byte. This field MAY be interpreted as an OEM_STRING.

AttributeValue (variable): This field contains the value of an extended file attribute. The value is expressed as an array of extended ASCII (OEM) characters. This array MUST NOT be null-terminated, and its length MUST NOT exceed 65,535 bytes.