The branch, master has been updated
       via  f1befc5 s3/smbd: Fix error code for unsupported SET_INFO requests
       via  ce884ee s3/smbd: Add new file information classes
       via  4b25c9f vfs_default: use VFS statvfs macro in fs_capabilities
       via  2724e0c vfs_ceph: add fs_capabilities hook to avoid local statvfs
      from  3297f4c Mark wbinfo test flapping

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f1befc5d5371d531e9aa2b0df73c119b78c2b4cc
Author: Justin Maggard via samba-technical <[email protected]>
Date:   Tue Jan 9 12:04:16 2018 -0800

    s3/smbd: Fix error code for unsupported SET_INFO requests
    
    FileValidDataLengthInformation and FileShortNameInformation are both
    valid FileInfoClasses that we don't support.  According to [MS-SMB2]
    3.3.5.21.1, we should be returning STATUS_NOT_SUPPORTED instead of
    NT_STATUS_INVALID_LEVEL for these.
    
    Signed-off-by: Justin Maggard <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    
    Autobuild-User(master): Jeremy Allison <[email protected]>
    Autobuild-Date(master): Sat Jan 13 07:25:42 CET 2018 on sn-devel-144

commit ce884eeb491e53aab6feb4cb5f49fc61ed89c394
Author: Justin Maggard via samba-technical <[email protected]>
Date:   Tue Jan 9 12:04:15 2018 -0800

    s3/smbd: Add new file information classes
    
    Add definitions for missing file information classes documented in
    [MS-FSCC] section 2.4.
    
    Signed-off-by: Justin Maggard <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>

commit 4b25c9f4a4d336a16894452862ea059701b025de
Author: David Disseldorp <[email protected]>
Date:   Wed Jan 10 14:03:09 2018 +0100

    vfs_default: use VFS statvfs macro in fs_capabilities
    
    Currently the vfs_default fs_capabilities handler calls statvfs
    directly, rather than calling the vfs macro. This behaviour may cause
    issues for VFS modules that delegate fs_capabilities handling to
    vfs_default but offer their own statvfs hook.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13208
    
    Signed-off-by: David Disseldorp <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 2724e0cac29cd1632ea28075a740fcc888affb36
Author: David Disseldorp <[email protected]>
Date:   Wed Jan 10 01:37:14 2018 +0100

    vfs_ceph: add fs_capabilities hook to avoid local statvfs
    
    Adding the fs_capabilities() hook to the CephFS VFS module avoids
    fallback to the vfs_default code-path, which calls statvfs() against the
    share path on the *local* filesystem.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13208
    
    Signed-off-by: David Disseldorp <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 source3/include/trans2.h      | 12 +++++++++++-
 source3/modules/vfs_ceph.c    | 15 +++++++++++++++
 source3/modules/vfs_default.c | 14 +++++++-------
 source3/smbd/trans2.c         |  5 +++++
 4 files changed, 38 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/trans2.h b/source3/include/trans2.h
index 3085344..ece436a 100644
--- a/source3/include/trans2.h
+++ b/source3/include/trans2.h
@@ -329,7 +329,17 @@ Byte offset   Type     name                description
 #define SMB_FILE_NETWORK_OPEN_INFORMATION              1034
 #define SMB_FILE_ATTRIBUTE_TAG_INFORMATION             1035
 #define SMB_FILE_TRACKING_INFORMATION                  1036
-#define SMB_FILE_MAXIMUM_INFORMATION                   1037
+#define SMB_FILE_ID_BOTH_DIRECTORY_INFORMATION         1037
+#define SMB_FILE_ID_FULL_DIRECTORY_INFORMATION         1038
+#define SMB_FILE_VALID_DATA_LENGTH_INFORMATION         1039
+#define SMB_FILE_SHORT_NAME_INFORMATION                        1040
+#define SMB_FILE_SFIO_RESERVE_INFORMATION              1044
+#define SMB_FILE_SFIO_VOLUME_INFORMATION               1045
+#define SMB_FILE_HARD_LINK_INFORMATION                 1046
+#define SMB_FILE_NORMALIZED_NAME_INFORMATION           1048
+#define SMB_FILE_ID_GLOBAL_TX_DIRECTORY_INFORMATION    1050
+#define SMB_FILE_STANDARD_LINK_INFORMATION             1054
+#define SMB_FILE_MAXIMUM_INFORMATION                   1055
 
 /* NT passthough levels for qfsinfo. */
 
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index b4a7cee..d612131 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -270,6 +270,20 @@ static int cephwrap_statvfs(struct vfs_handle_struct 
*handle,
        return ret;
 }
 
+static uint32_t cephwrap_fs_capabilities(struct vfs_handle_struct *handle,
+                                        enum timestamp_set_resolution 
*p_ts_res)
+{
+       uint32_t caps = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+
+#ifdef HAVE_CEPH_STATX
+       *p_ts_res = TIMESTAMP_SET_NT_OR_BETTER;
+#else
+       *p_ts_res = TIMESTAMP_SET_MSEC;
+#endif
+
+       return caps;
+}
+
 /* Directory operations */
 
 static DIR *cephwrap_opendir(struct vfs_handle_struct *handle,
@@ -1399,6 +1413,7 @@ static struct vfs_fn_pointers ceph_fns = {
        .get_quota_fn = cephwrap_get_quota,
        .set_quota_fn = cephwrap_set_quota,
        .statvfs_fn = cephwrap_statvfs,
+       .fs_capabilities_fn = cephwrap_fs_capabilities,
 
        /* Directory operations */
 
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 073c790..a26bec4 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -129,8 +129,14 @@ static uint32_t vfswrap_fs_capabilities(struct 
vfs_handle_struct *handle,
        struct vfs_statvfs_struct statbuf;
        int ret;
 
+       smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
+                                             NULL, NULL, 0);
+       if (smb_fname_cpath == NULL) {
+               return caps;
+       }
+
        ZERO_STRUCT(statbuf);
-       ret = sys_statvfs(conn->connectpath, &statbuf);
+       ret = SMB_VFS_STATVFS(conn, smb_fname_cpath, &statbuf);
        if (ret == 0) {
                caps = statbuf.FsCapabilities;
        }
@@ -140,12 +146,6 @@ static uint32_t vfswrap_fs_capabilities(struct 
vfs_handle_struct *handle,
        /* Work out what timestamp resolution we can
         * use when setting a timestamp. */
 
-       smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
-                                             NULL, NULL, 0);
-       if (smb_fname_cpath == NULL) {
-               return caps;
-       }
-
        ret = SMB_VFS_STAT(conn, smb_fname_cpath);
        if (ret == -1) {
                TALLOC_FREE(smb_fname_cpath);
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index dbad71b..512918e 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -8541,6 +8541,11 @@ NTSTATUS smbd_do_setfilepathinfo(connection_struct *conn,
                        break;
                }
 
+               /* [MS-SMB2] 3.3.5.21.1 states we MUST fail with 
STATUS_NOT_SUPPORTED. */
+               case SMB_FILE_VALID_DATA_LENGTH_INFORMATION:
+               case SMB_FILE_SHORT_NAME_INFORMATION:
+                       return NT_STATUS_NOT_SUPPORTED;
+
                /*
                 * CIFS UNIX extensions.
                 */


-- 
Samba Shared Repository

Reply via email to