Commit d2c87ba6 authored by Stefan Metzmacher's avatar Stefan Metzmacher Committed by Karolin Seeger

s4:libcli/raw: add RAW_FILEINFO_NORMALIZED_NAME_INFORMATION support

This is supported over the wire in SMB 3.1.1 on starting with
Windows 10 1803.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13919Signed-off-by: default avatarStefan Metzmacher <metze@samba.org>
Reviewed-by: default avatarJeremy Allison <jra@samba.org>
(cherry picked from commit 0c602319)
parent e8a1f4c2
...@@ -461,6 +461,7 @@ enum smb_fileinfo_level { ...@@ -461,6 +461,7 @@ enum smb_fileinfo_level {
RAW_FILEINFO_COMPRESSION_INFORMATION = SMB_QFILEINFO_COMPRESSION_INFORMATION, RAW_FILEINFO_COMPRESSION_INFORMATION = SMB_QFILEINFO_COMPRESSION_INFORMATION,
RAW_FILEINFO_NETWORK_OPEN_INFORMATION = SMB_QFILEINFO_NETWORK_OPEN_INFORMATION, RAW_FILEINFO_NETWORK_OPEN_INFORMATION = SMB_QFILEINFO_NETWORK_OPEN_INFORMATION,
RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION = SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION, RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION = SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION,
RAW_FILEINFO_NORMALIZED_NAME_INFORMATION= SMB_QFILEINFO_NORMALIZED_NAME_INFORMATION,
/* SMB2 specific levels */ /* SMB2 specific levels */
RAW_FILEINFO_SMB2_ALL_EAS = 0x0f01, RAW_FILEINFO_SMB2_ALL_EAS = 0x0f01,
RAW_FILEINFO_SMB2_ALL_INFORMATION = 0x1201 RAW_FILEINFO_SMB2_ALL_INFORMATION = 0x1201
...@@ -643,6 +644,8 @@ union smb_fileinfo { ...@@ -643,6 +644,8 @@ union smb_fileinfo {
} ea_info; } ea_info;
/* RAW_FILEINFO_NAME_INFO and RAW_FILEINFO_NAME_INFORMATION interfaces */ /* RAW_FILEINFO_NAME_INFO and RAW_FILEINFO_NAME_INFORMATION interfaces */
/* RAW_FILEINFO_ALT_NAME_INFO and RAW_FILEINFO_ALT_NAME_INFORMATION interfaces */
/* RAW_FILEINFO_NORMALIZED_NAME_INFORMATION interface */
struct { struct {
enum smb_fileinfo_level level; enum smb_fileinfo_level level;
struct { struct {
...@@ -651,7 +654,7 @@ union smb_fileinfo { ...@@ -651,7 +654,7 @@ union smb_fileinfo {
struct { struct {
struct smb_wire_string fname; struct smb_wire_string fname;
} out; } out;
} name_info; } name_info, alt_name_info, normalized_name_info;
/* RAW_FILEINFO_ALL_INFO and RAW_FILEINFO_ALL_INFORMATION interfaces */ /* RAW_FILEINFO_ALL_INFO and RAW_FILEINFO_ALL_INFORMATION interfaces */
struct { struct {
...@@ -704,17 +707,6 @@ union smb_fileinfo { ...@@ -704,17 +707,6 @@ union smb_fileinfo {
} out; } out;
} all_info2; } all_info2;
/* RAW_FILEINFO_ALT_NAME_INFO and RAW_FILEINFO_ALT_NAME_INFORMATION interfaces */
struct {
enum smb_fileinfo_level level;
struct {
union smb_handle_or_path file;
} in;
struct {
struct smb_wire_string fname;
} out;
} alt_name_info;
/* RAW_FILEINFO_STREAM_INFO and RAW_FILEINFO_STREAM_INFORMATION interfaces */ /* RAW_FILEINFO_STREAM_INFO and RAW_FILEINFO_STREAM_INFORMATION interfaces */
struct { struct {
enum smb_fileinfo_level level; enum smb_fileinfo_level level;
......
...@@ -219,6 +219,13 @@ NTSTATUS smb_raw_fileinfo_passthru_parse(const DATA_BLOB *blob, TALLOC_CTX *mem_ ...@@ -219,6 +219,13 @@ NTSTATUS smb_raw_fileinfo_passthru_parse(const DATA_BLOB *blob, TALLOC_CTX *mem_
parms->attribute_tag_information.out.reparse_tag = IVAL(blob->data, 4); parms->attribute_tag_information.out.reparse_tag = IVAL(blob->data, 4);
return NT_STATUS_OK; return NT_STATUS_OK;
case RAW_FILEINFO_NORMALIZED_NAME_INFORMATION:
FINFO_CHECK_MIN_SIZE(4);
smbcli_blob_pull_string(NULL, mem_ctx, blob,
&parms->normalized_name_info.out.fname,
0, 4, STR_UNICODE);
return NT_STATUS_OK;
case RAW_FILEINFO_SMB2_ALL_EAS: case RAW_FILEINFO_SMB2_ALL_EAS:
FINFO_CHECK_MIN_SIZE(4); FINFO_CHECK_MIN_SIZE(4);
return ea_pull_list_chained(blob, mem_ctx, return ea_pull_list_chained(blob, mem_ctx,
...@@ -443,6 +450,10 @@ static NTSTATUS smb_raw_info_backend(struct smbcli_session *session, ...@@ -443,6 +450,10 @@ static NTSTATUS smb_raw_info_backend(struct smbcli_session *session,
return smb_raw_fileinfo_passthru_parse(blob, mem_ctx, return smb_raw_fileinfo_passthru_parse(blob, mem_ctx,
RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION, parms); RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION, parms);
case RAW_FILEINFO_NORMALIZED_NAME_INFORMATION:
return smb_raw_fileinfo_passthru_parse(blob, mem_ctx,
RAW_FILEINFO_NORMALIZED_NAME_INFORMATION, parms);
case RAW_FILEINFO_SMB2_ALL_INFORMATION: case RAW_FILEINFO_SMB2_ALL_INFORMATION:
return smb_raw_fileinfo_passthru_parse(blob, mem_ctx, return smb_raw_fileinfo_passthru_parse(blob, mem_ctx,
RAW_FILEINFO_SMB2_ALL_INFORMATION, parms); RAW_FILEINFO_SMB2_ALL_INFORMATION, parms);
......
...@@ -139,6 +139,7 @@ Found 8 aliased levels ...@@ -139,6 +139,7 @@ Found 8 aliased levels
#define SMB_QFILEINFO_COMPRESSION_INFORMATION 1028 #define SMB_QFILEINFO_COMPRESSION_INFORMATION 1028
#define SMB_QFILEINFO_NETWORK_OPEN_INFORMATION 1034 #define SMB_QFILEINFO_NETWORK_OPEN_INFORMATION 1034
#define SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION 1035 #define SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION 1035
#define SMB_QFILEINFO_NORMALIZED_NAME_INFORMATION 1048
......
...@@ -960,6 +960,8 @@ NTSTATUS ntvfs_map_fileinfo(TALLOC_CTX *mem_ctx, ...@@ -960,6 +960,8 @@ NTSTATUS ntvfs_map_fileinfo(TALLOC_CTX *mem_ctx,
case RAW_FILEINFO_SMB2_ALL_EAS: case RAW_FILEINFO_SMB2_ALL_EAS:
case RAW_FILEINFO_SMB2_ALL_INFORMATION: case RAW_FILEINFO_SMB2_ALL_INFORMATION:
return NT_STATUS_INVALID_LEVEL; return NT_STATUS_INVALID_LEVEL;
case RAW_FILEINFO_NORMALIZED_NAME_INFORMATION:
return NT_STATUS_NOT_SUPPORTED;
} }
return NT_STATUS_INVALID_LEVEL; return NT_STATUS_INVALID_LEVEL;
......
...@@ -342,6 +342,8 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs, ...@@ -342,6 +342,8 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
case RAW_FILEINFO_UNIX_INFO2: case RAW_FILEINFO_UNIX_INFO2:
case RAW_FILEINFO_UNIX_LINK: case RAW_FILEINFO_UNIX_LINK:
return NT_STATUS_INVALID_LEVEL; return NT_STATUS_INVALID_LEVEL;
case RAW_FILEINFO_NORMALIZED_NAME_INFORMATION:
return NT_STATUS_NOT_SUPPORTED;
} }
return NT_STATUS_INVALID_LEVEL; return NT_STATUS_INVALID_LEVEL;
......
...@@ -1697,6 +1697,10 @@ static bool cmp_fileinfo(int instance, ...@@ -1697,6 +1697,10 @@ static bool cmp_fileinfo(int instance,
CHECK_EQUAL(attribute_tag_information.out.reparse_tag); CHECK_EQUAL(attribute_tag_information.out.reparse_tag);
break; break;
case RAW_FILEINFO_NORMALIZED_NAME_INFORMATION:
CHECK_WSTR_EQUAL(normalized_name_info.out.fname);
break;
case RAW_FILEINFO_SMB2_ALL_INFORMATION: case RAW_FILEINFO_SMB2_ALL_INFORMATION:
CHECK_NTTIMES_EQUAL(all_info2.out.create_time); CHECK_NTTIMES_EQUAL(all_info2.out.create_time);
CHECK_NTTIMES_EQUAL(all_info2.out.access_time); CHECK_NTTIMES_EQUAL(all_info2.out.access_time);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment