diff options
author | Aurelien Aptel <aaptel@suse.com> | 2020-02-08 15:50:57 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-03-23 04:49:09 +0100 |
commit | 349e13ad30b45998bb9937cfe0b32be6f951976d (patch) | |
tree | 3827a85fd082bb28d8194b3ae733e41d17155b18 /fs/cifs/smb2pdu.h | |
parent | cifs: rename posix create rsp (diff) | |
download | linux-349e13ad30b45998bb9937cfe0b32be6f951976d.tar.xz linux-349e13ad30b45998bb9937cfe0b32be6f951976d.zip |
cifs: add smb2 POSIX info level
* add new info level and structs for SMB2 posix extension
* add functions to parse and validate it
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smb2pdu.h')
-rw-r--r-- | fs/cifs/smb2pdu.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 3addecebc25d..700311978523 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -1613,5 +1613,49 @@ struct create_posix_rsp { * var sized group SID */ } __packed; + +/* + * SMB2-only POSIX info level + * + * See posix_info_sid_size(), posix_info_extra_size() and + * posix_info_parse() to help with the handling of this struct. + */ +struct smb2_posix_info { + __le32 NextEntryOffset; + __u32 Ignored; + __le64 CreationTime; + __le64 LastAccessTime; + __le64 LastWriteTime; + __le64 ChangeTime; + __le64 EndOfFile; + __le64 AllocationSize; + __le32 DosAttributes; + __le64 Inode; + __le32 DeviceId; + __le32 Zero; + /* beginning of POSIX Create Context Response */ + __le32 HardLinks; + __le32 ReparseTag; + __le32 Mode; + /* + * var sized owner SID + * var sized group SID + * le32 filenamelength + * u8 filename[] + */ +} __packed; + +/* + * Parsed version of the above struct. Allows direct access to the + * variable length fields + */ +struct smb2_posix_info_parsed { + const struct smb2_posix_info *base; + size_t size; + struct cifs_sid owner; + struct cifs_sid group; + int name_len; + const u8 *name; }; + #endif /* _SMB2PDU_H */ |