[POSIX-FSCC] POSIX Extensions to MS-FSCC

Specifies the MS-FSCC extensions for supporting POSIX compliant operating systems.

Published Version

Date

Protocol Revision

Revision Class

Downloads

Previous Versions

Date

Protocol Revision

Revision Class

Downloads

1 Introduction

The SMB3 POSIX Extensions are extensions to enable POSIX compliant operating systems to better interoperate with SMB3 servers and storage appliances. This document specified the extensions to the [MS-FSCC] specification. Popular servers such as Samba, Windows Server and others support SMB3 by default. These extensions are already implemented in multiple clients and servers.

2 Messages and Structures

2.1 Common Data Types

2.1.1 POSIX Mode


1

3
0


9


8


7


6


5


4


3


2


1

2
0


9


8


7


6


5


4


3


2


1

1
0


9


8


7


6


5


4


3


2


1


0

Reserved

Type

S
U

S
G

S
T

R
U

W
U

X
U

R
G

W
G

X
G

R
O

W
O

X
O

2.1.1.1 POSIX Mode Bit Definitions

Value

Meaning

XO (0x00000001)

Others have execute permission (S_IXOTH)

WO (0x00000002)

Others have write permission (S_IWOTH)

RO (0x00000004)

Others have read permission (S_IROTH)

XG (0x00000008)

Group has execute permission (S_IXGRP)

WG (0x00000010)

Group has write permission (S_IWGRP)

RG (0x00000020)

Group has read permission (S_IRGRP)

XU (0x00000040)

User has execute permission (S_IXUSR)

WU (0x00000080)

User has write permission (S_IWUSR)

RU (0x00000100)

User has read permission (S_IRUSR)

ST (0x00000200)

Sticky bit (S_ISVTX)

SG (0x00000400)

Set-group-ID bit (S_ISGID)

SU (0x00000800)

Set-user-ID bit (S_ISUID)

Type

The POSIX file type as an enumeration defined in POSIX File Type Definition

2.1.1.2 POSIX File Type Definition

Value

Meaning

0

A regular file (S_IFREG)

1

A directory (S_IFDIR)

2

A symlink (S_IFLNK)

3

A character device (S_IFCHR)

4

A block device (S_IFBLK)

5

A FIFO (S_IFIFO)

6

A socket (S_IFSOCK)

2.3 Structures

2.3.1 File Information Classes

Refer to section 2.4 of [MS-FSCC] for additional details. This section only explains details relevant to the FilePosixInformation info class.

File information class

Level

Uses

FilePosixInformation

0x64

Query

2.3.1.1 FilePosixInformation

This information class is used to query file posix information.

A FILE_POSIX_INFORMATION data element, defined as follows, is returned by the server.


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

CreationTime

...

LastAccessTime

...

LastWriteTime

...

ChangeTime

...

EndOfFile

...

AllocationSize

...

FileAttributes

Inode

...

Device

Reserved

NumberOfLinks

ReparseTag

POSIXMode

OwnerSID (variable)

...

GroupSID (variable)

...

FilenameLength

Filename (variable)

...

CreationTime (8 bytes): The time when the file was created; see section 2.1.1 of [MS-FSCC]. A valid time for this field is an integer greater than or equal to 0. When setting file attributes, a value of 0 indicates to the server that it MUST NOT change this attribute. When setting file attributes, a value of -1 indicates to the server that it MUST NOT change this attribute for all subsequent operations on the same file handle. When setting file attributes, a value of -2 indicates to the server that it MUST change this attribute for all subsequent operations on the same file handle. This field MUST NOT be set to a value less than -2.

LastAccessTime (8 bytes): The last time the file was accessed; see section 2.1.1 of [MS-FSCC]. A valid time for this field is an integer greater than or equal to 0. When setting file attributes, a value of 0 indicates to the server that it MUST NOT change this attribute. When setting file attributes, a value of -1 indicates to the server that it MUST NOT change this attribute for all subsequent operations on the same file handle. When setting file attributes, a value of -2 indicates to the server that it MUST change this attribute for all subsequent operations on the same file handle. This field MUST NOT be set to a value less than -2.

LastWriteTime (8 bytes): The last time information was written to the file; see section 2.1.1 of [MS-FSCC]. A valid time for this field is an integer greater than or equal to 0. When setting file attributes, a value of 0 indicates to the server that it MUST NOT change this attribute. When setting file attributes, a value of -1 indicates to the server that it MUST NOT change this attribute for all subsequent operations on the same file handle. When setting file attributes, a value of -2 indicates to the server that it MUST change this attribute for all subsequent operations on the same file handle. This field MUST NOT be set to a value less than -2.

ChangeTime (8 bytes): The last time the file was changed; see section 2.1.1 of [MS-FSCC]. A valid time for this field is an integer greater than or equal to 0. When setting file attributes, a value of 0 indicates to the server that it MUST NOT change this attribute. When setting file attributes, a value of -1 indicates to the server that it MUST NOT change this attribute for all subsequent operations on the same file handle. When setting file attributes, a value of -2 indicates to the server that it MUST change this attribute for all subsequent operations on the same file handle. This field MUST NOT be set to a value less than -2.

EndOfFile (8 bytes): The size of the file.

AllocationSize (8 bytes): The size allocated on disk for the file.

FileAttributes (4 bytes): A 32-bit unsigned integer that contains the file attributes. Valid file attributes are specified in section 2.6 of [MS-FSCC].

Inode (8 bytes): The POSIX inode for the file.

FileId (4 bytes): The POSIX fileId for the file.

Reserved (4 bytes): A 32-bit field. This field is reserved. This field can be set to any value, and MUST be ignored.

NumberOfLinks (4 bytes): The number of hard links to the file.

ReparseTag (4 bytes): The reparse tag, as defined in section 2.1.2.1 of [MS-FSCC].

POSIXMode (4 bytes): The POSIX mode as defined in POSIX-FSCC 2.1.1.

OwnerSID (variable): The owner SID as defined in Microsoft Security identifiers.

GroupSID (variable): The group SID as defined in Microsoft Security identifiers.

FilenameLength (4 bytes): The length, in bytes, of the filename.

Filename (variable): A variable-length buffer containing the filename, the length specified by FilenameLength.

2.3.2 File System Information Classes

Refer to section 2.5 of [MS-FSCC] for additional details. This section only explains details relevant to the FileFsPosixInformation info class.

File system information class

Level

Uses

FileFsPosixInformation

0x64

Query

2.3.2.1 FileFsPosixInformation

This information class is used to query file system posix information.

A FILE_FS_POSIX_INFORMATION data element, defined as follows, is returned by the server.


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

OptimalTransferSize

BlockSize

TotalBlocks

...

BlocksAvailable

...

UserBlocksAvailable

...

TotalFileNodes

...

FreeFileNodes

...

FsIdentifier

...

OptimalTransferSize (4 bytes): The preferred length of I/O requests for files on this file system., from struct statvfs.f_bsize.

BlockSize (4 bytes): The size in bytes of the minimum unit of allocation on this filesystem, from struct statvfs.f_frsize.

TotalBlocks (8 bytes): Size of filesystem in BlockSize units, from struct statvfs.f_blocks.

BlocksAvailable (8 bytes): Number of free blocks in BlockSize units, from struct statvfs.f_bfree.

UserBlocksAvailable (8 bytes): Number of free blocks for unprivileged users in BlockSize units, from struct statvfs.f_bavail.

TotalFileNodes (8 bytes): Number of inodes, from struct statvfs.f_files.

FreeFileNodes (8 bytes): Number of free inodes, from struct statvfs.f_ffree.

FsIdentifier (8 bytes): Filesystem ID, from struct statvfs.f_fsid.