diff --git a/source3/include/trans2.h b/source3/include/trans2.h index 9d5cfdea7e0..21b2a3588e8 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -342,7 +342,6 @@ Byte offset Type name description /* As yet undefined FSCC_ code for POSIX info level. */ #define FSCC_FILE_POSIX_INFORMATION 100 -#define SMB2_FS_POSIX_INFORMATION 100 /* MS-FSCC 2.4 File System Information Classes */ @@ -356,6 +355,9 @@ Byte offset Type name description #define FSCC_FS_OBJECTID_INFORMATION 8 #define FSCC_FS_SECTOR_SIZE_INFORMATION 11 +/* As yet undefined FSCC_ code for POSIX info level. */ +#define FSCC_FS_POSIX_INFORMATION 100 + /* NT passthrough levels... */ #define NT_PASSTHROUGH_OFFSET 1000 @@ -412,7 +414,6 @@ Byte offset Type name description #define SMB2_FILE_RENAME_INFORMATION_INTERNAL (FSCC_FILE_RENAME_INFORMATION + SMB2_INFO_SPECIAL) #define SMB2_FILE_FULL_EA_INFORMATION (FSCC_FILE_FULL_EA_INFORMATION + SMB2_INFO_SPECIAL) #define SMB2_FILE_ALL_INFORMATION (FSCC_FILE_ALL_INFORMATION + SMB2_INFO_SPECIAL) -#define SMB2_FS_POSIX_INFORMATION_INTERNAL (SMB2_FS_POSIX_INFORMATION + NT_PASSTHROUGH_OFFSET) /* NT passthrough levels for qfsinfo. */ diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c index f9a82089709..155bc6ae353 100644 --- a/source3/libsmb/cli_smb2_fnum.c +++ b/source3/libsmb/cli_smb2_fnum.c @@ -5145,7 +5145,7 @@ static void cli_smb2_get_posix_fs_info_opened(struct tevent_req *subreq) state->cli, state->fnum, SMB2_0_INFO_FILESYSTEM, /* in_info_type */ - SMB2_FS_POSIX_INFORMATION, /* in_file_info_class */ + FSCC_FS_POSIX_INFORMATION, /* in_file_info_class */ 0xFFFF, /* in_max_output_length */ NULL, /* in_input_buffer */ 0, /* in_additional_info */ diff --git a/source3/smbd/smb2_getinfo.c b/source3/smbd/smb2_getinfo.c index f7802174cad..7264263a121 100644 --- a/source3/smbd/smb2_getinfo.c +++ b/source3/smbd/smb2_getinfo.c @@ -465,8 +465,15 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx, int data_size = 0; size_t fixed_portion; - /* the levels directly map to the passthru levels */ - file_info_level = in_file_info_class + NT_PASSTHROUGH_OFFSET; + switch (in_file_info_class) { + case FSCC_FS_POSIX_INFORMATION: + file_info_level = in_file_info_class; + break; + default: + /* the levels directly map to the passthru levels */ + file_info_level = in_file_info_class + NT_PASSTHROUGH_OFFSET; + break; + } status = smbd_do_qfsinfo(smb2req->xconn, conn, state, file_info_level, diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index 960c4d74821..60b9b92e480 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -1960,7 +1960,7 @@ static bool fsinfo_unix_valid_level(connection_struct *conn, { if (conn_using_smb2(conn->sconn) && fsp->fsp_flags.posix_open && - info_level == SMB2_FS_POSIX_INFORMATION_INTERNAL) + info_level == FSCC_FS_POSIX_INFORMATION) { return true; } @@ -2473,7 +2473,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned #endif case SMB_QUERY_POSIX_FS_INFO: - case SMB2_FS_POSIX_INFORMATION_INTERNAL: + case FSCC_FS_POSIX_INFORMATION: { int rc; struct vfs_statvfs_struct svfs;