]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_default: use VFS statvfs macro in fs_capabilities
authorDavid Disseldorp <ddiss@samba.org>
Wed, 10 Jan 2018 13:03:09 +0000 (14:03 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 22 Jan 2018 12:14:03 +0000 (13:14 +0100)
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 <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 4b25c9f4a4d336a16894452862ea059701b025de)

Autobuild-User(v4-6-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-6-test): Mon Jan 22 13:14:03 CET 2018 on sn-devel-144

source3/modules/vfs_default.c

index ce1b6e2569306ccf01564dcbd0752264aef171cc..48895910c39c682d33e801b877142288947491ca 100644 (file)
@@ -121,8 +121,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, conn->connectpath, &statbuf);
        if (ret == 0) {
                caps = statbuf.FsCapabilities;
        }
@@ -132,12 +138,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);