]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: rename SMB2_FS_POSIX_INFORMATION to FSCC_FS_POSIX_INFORMATION
authorRalph Boehme <slow@samba.org>
Tue, 26 Nov 2024 19:00:01 +0000 (20:00 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 27 Nov 2024 18:22:28 +0000 (18:22 +0000)
Streamline the info-level defines. Also get rid of
SMB2_FS_POSIX_INFORMATION_INTERNAL which is not needed for an info-level that
is exclusive to SMB2.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/include/trans2.h
source3/libsmb/cli_smb2_fnum.c
source3/smbd/smb2_getinfo.c
source3/smbd/smb2_trans2.c

index 9d5cfdea7e0bf1e33a0389bec4dd213a4be64b0d..21b2a3588e8ec3875c4163c4ebee638a3ca28123 100644 (file)
@@ -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. */
 
index f9a820897097d8a637b310b1e1b5a1ed7749d0bb..155bc6ae353cd05fa6da5af617ee15d2afca9ac0 100644 (file)
@@ -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 */
index f7802174cadab1526589fdf6f79cccf5e9191c8a..7264263a1211f2af8eb925165d9562bcd176eadf 100644 (file)
@@ -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,
index 960c4d748219b89196299156522a86bc93c0a32e..60b9b92e4807848c39508236a03692799c7776f8 100644 (file)
@@ -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;