The branch, master has been updated
       via  52744d35a37 nmbd: Reduce the wait interface loop sleep time
       via  96f1af04ffc s3: VFS: Remove SMB_VFS_READDIR_ATTR(), no longer used
       via  1fa6d75b434 s3: VFS: fruit: Remove SMB_VFS_READDIR_ATTR()
       via  cb563e63267 s3: VFS: catia: Remove SMB_VFS_READDIR_ATTR()
       via  36a074bb1a2 s3: smbd: Skip calling SMB_VFS_FREADDIR_ATTR() for 
symlinks
       via  289b9b1382c s3: smbd: Switch from SMB_VFS_READDIR_ATTR() to 
SMB_VFS_FREADDIR_ATTR()
       via  45578328a6f s3: VFS: fruit: Implement SMB_VFS_FREADDIR_ATTR()
       via  6df8709fc98 VFS: Add SMB_VFS_FREADDIR_ATTR()
      from  9be3be8aca8 build: wscript. Fix the build on FreeBSD with the clang 
ld.lld-XX linker.

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


- Log -----------------------------------------------------------------
commit 52744d35a37680c382800539a4c88d553496dbec
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Fri May 14 12:35:44 2021 +0200

    nmbd: Reduce the wait interface loop sleep time
    
    Under some circumstances the network-online.target can be reached
    without an IPv4 address, for example when using systemd-networkd and
    having systemd-networkd-wait-online.service disabled. This will trigger
    a five seconds sleep which seems a bit excessive. It is specially
    critical when winbind.service is enabled as it won't be started until
    nmbd.service is running, delaying the systemd-logind.service five seconds.
    
    Reduce the sleep time from 5 seconds to 250ms to exit the loop as soon
    as possible.
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@samba.org>
    Autobuild-Date(master): Fri May 14 20:52:47 UTC 2021 on sn-devel-184

commit 96f1af04ffce5e276443e390d5d6339dbf17a06d
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Thu May 13 13:36:31 2021 +0200

    s3: VFS: Remove SMB_VFS_READDIR_ATTR(), no longer used
    
                                 ----------------
                                /                \
                               /       REST       \
                              /         IN         \
                             /         PEACE        \
                            /                        \
                            |                        |
                            |  SMB_VFS_READDIR_ATTR  |
                            |                        |
                            |                        |
                            |         13 May         |
                            |          2021          |
                            |                        |
                            |                        |
                           *|     *  *  *            | *
                  _________)/\\_//(\/(/\)/\//\/\///\/|_)_______
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 1fa6d75b434f27962f76b339d6a4bb28756c836a
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Thu May 13 13:19:09 2021 +0200

    s3: VFS: fruit: Remove SMB_VFS_READDIR_ATTR()
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit cb563e63267c239dde1900d6f3fc03005da04d36
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Thu May 13 13:18:23 2021 +0200

    s3: VFS: catia: Remove SMB_VFS_READDIR_ATTR()
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 36a074bb1a23df2bc6e4d6c6b6cfd7023e6ea58d
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Thu May 13 17:01:47 2021 +0200

    s3: smbd: Skip calling SMB_VFS_FREADDIR_ATTR() for symlinks
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>

commit 289b9b1382cf62f5ce7d3ac384276da4ab12d733
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Thu May 13 13:17:19 2021 +0200

    s3: smbd: Switch from SMB_VFS_READDIR_ATTR() to SMB_VFS_FREADDIR_ATTR()
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 45578328a6f25617ff183257d719dd9100590545
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Thu May 13 13:08:20 2021 +0200

    s3: VFS: fruit: Implement SMB_VFS_FREADDIR_ATTR()
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 6df8709fc9879049e95176f72193aa255e1b1452
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon May 10 12:38:58 2021 +0200

    VFS: Add SMB_VFS_FREADDIR_ATTR()
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

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

Summary of changes:
 examples/VFS/skel_opaque.c            | 10 +++++-----
 examples/VFS/skel_transparent.c       | 12 ++++++------
 source3/include/vfs.h                 | 26 +++++++++++++------------
 source3/include/vfs_macros.h          |  8 ++++----
 source3/modules/The_New_VFS.org       |  4 +---
 source3/modules/The_New_VFS.txt       |  4 +---
 source3/modules/vfs_catia.c           | 33 --------------------------------
 source3/modules/vfs_default.c         | 10 +++++-----
 source3/modules/vfs_fruit.c           | 36 +++++++++++++++++++----------------
 source3/modules/vfs_full_audit.c      | 24 ++++++++++++-----------
 source3/modules/vfs_not_implemented.c | 10 +++++-----
 source3/modules/vfs_time_audit.c      | 18 +++++++++---------
 source3/nmbd/nmbd.c                   |  2 +-
 source3/nmbd/nmbd.h                   |  2 ++
 source3/nmbd/nmbd_subnetdb.c          |  4 ++--
 source3/smbd/trans2.c                 | 18 ++++++++++++++----
 source3/smbd/vfs.c                    | 17 ++++++++++-------
 17 files changed, 112 insertions(+), 126 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 256ab2a5e41..bb98c001d25 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -697,10 +697,10 @@ static NTSTATUS skel_fsctl(struct vfs_handle_struct 
*handle,
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
-static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle,
-                                 const struct smb_filename *fname,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct readdir_attr_data **pattr_data)
+static NTSTATUS skel_freaddir_attr(struct vfs_handle_struct *handle,
+                                  struct files_struct *fsp,
+                                  TALLOC_CTX *mem_ctx,
+                                  struct readdir_attr_data **pattr_data)
 {
        return NT_STATUS_NOT_IMPLEMENTED;
 }
@@ -1064,7 +1064,7 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .strict_lock_check_fn = skel_strict_lock_check,
        .translate_name_fn = skel_translate_name,
        .fsctl_fn = skel_fsctl,
-       .readdir_attr_fn = skel_readdir_attr,
+       .freaddir_attr_fn = skel_freaddir_attr,
        .audit_file_fn = skel_audit_file,
 
        /* DOS attributes. */
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index dfb324d52a3..4811bad3b2c 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -917,12 +917,12 @@ static NTSTATUS skel_fsctl(struct vfs_handle_struct 
*handle,
                                  in_len, _out_data, max_out_len, out_len);
 }
 
-static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle,
-                                 const struct smb_filename *fname,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct readdir_attr_data **pattr_data)
+static NTSTATUS skel_freaddir_attr(struct vfs_handle_struct *handle,
+                                  struct files_struct *fsp,
+                                  TALLOC_CTX *mem_ctx,
+                                  struct readdir_attr_data **pattr_data)
 {
-       return SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data);
+       return SMB_VFS_NEXT_FREADDIR_ATTR(handle, fsp, mem_ctx, pattr_data);
 }
 
 struct skel_get_dos_attributes_state {
@@ -1369,7 +1369,7 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .strict_lock_check_fn = skel_strict_lock_check,
        .translate_name_fn = skel_translate_name,
        .fsctl_fn = skel_fsctl,
-       .readdir_attr_fn = skel_readdir_attr,
+       .freaddir_attr_fn = skel_freaddir_attr,
        .audit_file_fn = skel_audit_file,
 
        /* DOS attributes. */
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 1af6bdec1fe..1c076c2c8f6 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -350,6 +350,8 @@
  * Version 45 - Add SMB_VFS_FNTIMES
  * Version 45 - Remove SMB_VFS_NTIMES
  * Version 45 - ADD SMB_VFS_FSTREAMINFO
+ * Version 45 - Add SMB_VFS_FREADDIR_ATTR
+ * Version 45 - Remove SMB_VFS_READDIR_ATTR
  */
 
 #define SMB_VFS_INTERFACE_VERSION 45
@@ -1269,10 +1271,10 @@ struct vfs_fn_pointers {
                                         struct files_struct **fsp,
                                         DATA_BLOB *new_cookie);
 
-       NTSTATUS (*readdir_attr_fn)(struct vfs_handle_struct *handle,
-                                   const struct smb_filename *fname,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct readdir_attr_data **attr_data);
+       NTSTATUS (*freaddir_attr_fn)(struct vfs_handle_struct *handle,
+                                    struct files_struct *fsp,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct readdir_attr_data **attr_data);
 };
 
 /*
@@ -1781,10 +1783,10 @@ NTSTATUS smb_vfs_call_durable_reconnect(struct 
vfs_handle_struct *handle,
                                        TALLOC_CTX *mem_ctx,
                                        struct files_struct **fsp,
                                        DATA_BLOB *new_cookie);
-NTSTATUS smb_vfs_call_readdir_attr(struct vfs_handle_struct *handle,
-                                  const struct smb_filename *fname,
-                                  TALLOC_CTX *mem_ctx,
-                                  struct readdir_attr_data **attr_data);
+NTSTATUS smb_vfs_call_freaddir_attr(struct vfs_handle_struct *handle,
+                                   struct files_struct *fsp,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct readdir_attr_data **attr_data);
 
 NTSTATUS smb_register_vfs(int version, const char *name,
                          const struct vfs_fn_pointers *fns);
@@ -2080,10 +2082,10 @@ NTSTATUS vfs_not_implemented_fsctl(struct 
vfs_handle_struct *handle,
                                   uint32_t in_len,
                                   uint8_t **_out_data,
                                   uint32_t max_out_len, uint32_t *out_len);
-NTSTATUS vfs_not_implemented_readdir_attr(struct vfs_handle_struct *handle,
-                                         const struct smb_filename *fname,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct readdir_attr_data 
**pattr_data);
+NTSTATUS vfs_not_implemented_freaddir_attr(struct vfs_handle_struct *handle,
+                                          struct files_struct *dirfsp,
+                                          TALLOC_CTX *mem_ctx,
+                                          struct readdir_attr_data 
**pattr_data);
 struct tevent_req *vfs_not_implemented_get_dos_attributes_send(
                        TALLOC_CTX *mem_ctx,
                        struct tevent_context *ev,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 3769593c2e4..0f69dcc930f 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -587,9 +587,9 @@
                                        (smb1req), (op), (old_cookie), \
                                        (mem_ctx), (fsp), (new_cookie))
 
-#define SMB_VFS_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \
-       smb_vfs_call_readdir_attr((conn)->vfs_handles, (fname), (mem_ctx), 
(attr_data))
-#define SMB_VFS_NEXT_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \
-       smb_vfs_call_readdir_attr((handle)->next, (fname), (mem_ctx), 
(attr_data))
+#define SMB_VFS_FREADDIR_ATTR(fsp, mem_ctx, attr_data) \
+       smb_vfs_call_freaddir_attr((fsp)->conn->vfs_handles, (fsp), (mem_ctx), 
(attr_data))
+#define SMB_VFS_NEXT_FREADDIR_ATTR(handle, fsp, mem_ctx, attr_data) \
+       smb_vfs_call_freaddir_attr((handle)->next, (fsp), (mem_ctx), 
(attr_data))
 
 #endif /* _VFS_MACROS_H */
diff --git a/source3/modules/The_New_VFS.org b/source3/modules/The_New_VFS.org
index b3437ecb7c2..f9d96995d4b 100644
--- a/source3/modules/The_New_VFS.org
+++ b/source3/modules/The_New_VFS.org
@@ -272,7 +272,7 @@ whenever VFS access is done in a piecemeal fashion.
 | SMB_VFS_PWRITE_SEND()             | [[fsp][fsp]]      | -      |
 | SMB_VFS_READ_DFS_PATHAT()         | [[Symlink][Symlink]]  | Todo   |
 | SMB_VFS_READDIR()                 | [[fsp][fsp]]      | -      |
-| SMB_VFS_READDIR_ATTR()            | [[Path][Path]]     | Todo   |
+| SMB_VFS_READDIR_ATTR()            | [[Path][Path]]    | -      |
 | SMB_VFS_READLINKAT()              | [[Symlink][Symlink]]  | -      |
 | SMB_VFS_REALPATH()                | [[P2px][P2px]]     | -      |
 | SMB_VFS_RECVFILE()                | [[fsp][fsp]]      | -      |
@@ -309,7 +309,6 @@ whenever VFS access is done in a piecemeal fashion.
 | VFS Function                    | Group    | Status |
 |---------------------------------+----------+--------|
 | SMB_VFS_SYS_ACL_DELETE_DEF_FD() | [[xpathref][xpathref]] | Todo   |
-| SMB_VFS_READDIR_ATTRAT()        | [[Enum][Enum]]     | Todo   |
 | SMB_VFS_FNTIMENS()              | [[fsp][fsp]]      | -      |
 |---------------------------------+----------+--------|
 
@@ -438,7 +437,6 @@ whenever VFS access is done in a piecemeal fashion.
 *** AT VFS functions needed for directory enumeration <<Enum>>
  - SMB_VFS_GET_DOS_ATTRIBUTES_SEND()
  - SMB_VFS_GETXATTRAT_SEND()
- - SMB_VFS_READDIR_ATTRAT() (NEW)
 *** Handle based VFS functions not allowed on O_PATH opened handles 
<<xpathref>>
  - SMB_VFS_FGETXATTR()
  - SMB_VFS_FLISTXATTR()
diff --git a/source3/modules/The_New_VFS.txt b/source3/modules/The_New_VFS.txt
index 7b97f8a0fce..003b740ebf0 100644
--- a/source3/modules/The_New_VFS.txt
+++ b/source3/modules/The_New_VFS.txt
@@ -340,7 +340,7 @@ Table of Contents
    SMB_VFS_PWRITE_SEND()              [fsp]       -
    SMB_VFS_READ_DFS_PATHAT()          [Symlink]   Todo
    SMB_VFS_READDIR()                  [fsp]       -
-   SMB_VFS_READDIR_ATTR()             [Path]      Todo
+   SMB_VFS_READDIR_ATTR()             [Path]      -
    SMB_VFS_READLINKAT()               [Symlink]   -
    SMB_VFS_REALPATH()                 [P2px]      -
    SMB_VFS_RECVFILE()                 [fsp]       -
@@ -399,7 +399,6 @@ Table of Contents
    VFS Function                     Group       Status
   ─────────────────────────────────────────────────────
    SMB_VFS_SYS_ACL_DELETE_DEF_FD()  [xpathref]  Todo
-   SMB_VFS_READDIR_ATTRAT()         [Enum]      Todo
    SMB_VFS_FNTIMENS()               [fsp]       -
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 
@@ -556,7 +555,6 @@ Table of Contents
 
   • SMB_VFS_GET_DOS_ATTRIBUTES_SEND()
   • SMB_VFS_GETXATTRAT_SEND()
-  • SMB_VFS_READDIR_ATTRAT() (NEW)
 
 
 2.2.7 Handle based VFS functions not allowed on O_PATH opened handles
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index c87fdda2239..e6709c86ca9 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -2000,38 +2000,6 @@ static NTSTATUS catia_set_compression(vfs_handle_struct 
*handle,
        return result;
 }
 
-static NTSTATUS catia_readdir_attr(struct vfs_handle_struct *handle,
-                                  const struct smb_filename *smb_fname_in,
-                                  TALLOC_CTX *mem_ctx,
-                                  struct readdir_attr_data **pattr_data)
-{
-       struct smb_filename *smb_fname;
-       char *fname = NULL;
-       NTSTATUS status;
-
-       status = catia_string_replace_allocate(handle->conn,
-                                              smb_fname_in->base_name,
-                                              &fname,
-                                              vfs_translate_to_unix);
-       if (!NT_STATUS_IS_OK(status)) {
-               errno = map_errno_from_nt_status(status);
-               return status;
-       }
-
-       smb_fname = synthetic_smb_fname(talloc_tos(),
-                                       fname,
-                                       NULL,
-                                       &smb_fname_in->st,
-                                       smb_fname_in->twrp,
-                                       0);
-
-       status = SMB_VFS_NEXT_READDIR_ATTR(handle, smb_fname, mem_ctx, 
pattr_data);
-
-       TALLOC_FREE(smb_fname);
-       TALLOC_FREE(fname);
-       return status;
-}
-
 static NTSTATUS catia_create_dfs_pathat(struct vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -2124,7 +2092,6 @@ static struct vfs_fn_pointers vfs_catia_fns = {
 
        /* Directory operations */
        .mkdirat_fn = catia_mkdirat,
-       .readdir_attr_fn = catia_readdir_attr,
 
        /* File operations */
        .openat_fn = catia_openat,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 27b38f50816..722a3424c31 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -631,10 +631,10 @@ static struct dirent *vfswrap_readdir(vfs_handle_struct 
*handle,
        return result;
 }
 
-static NTSTATUS vfswrap_readdir_attr(struct vfs_handle_struct *handle,
-                                    const struct smb_filename *fname,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct readdir_attr_data **attr_data)
+static NTSTATUS vfswrap_freaddir_attr(struct vfs_handle_struct *handle,
+                                     struct files_struct *fsp,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct readdir_attr_data **attr_data)
 {
        return NT_STATUS_NOT_SUPPORTED;
 }
@@ -3768,7 +3768,7 @@ static struct vfs_fn_pointers vfs_default_fns = {
 
        .fdopendir_fn = vfswrap_fdopendir,
        .readdir_fn = vfswrap_readdir,
-       .readdir_attr_fn = vfswrap_readdir_attr,
+       .freaddir_attr_fn = vfswrap_freaddir_attr,
        .seekdir_fn = vfswrap_seekdir,
        .telldir_fn = vfswrap_telldir,
        .rewind_dir_fn = vfswrap_rewinddir,
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 856a7beb650..3855e961e18 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -4191,10 +4191,10 @@ fail:
        return status;
 }
 
-static NTSTATUS fruit_readdir_attr(struct vfs_handle_struct *handle,
-                                  const struct smb_filename *fname,
-                                  TALLOC_CTX *mem_ctx,
-                                  struct readdir_attr_data **pattr_data)
+static NTSTATUS fruit_freaddir_attr(struct vfs_handle_struct *handle,
+                                   struct files_struct *fsp,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct readdir_attr_data **pattr_data)
 {
        struct fruit_config_data *config = NULL;
        struct readdir_attr_data *attr_data;
@@ -4207,10 +4207,13 @@ static NTSTATUS fruit_readdir_attr(struct 
vfs_handle_struct *handle,
                                return NT_STATUS_UNSUCCESSFUL);
 
        if (!global_fruit_config.nego_aapl) {
-               return SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, 
pattr_data);
+               return SMB_VFS_NEXT_FREADDIR_ATTR(handle,
+                                                 fsp,
+                                                 mem_ctx,
+                                                 pattr_data);
        }
 
-       DEBUG(10, ("fruit_readdir_attr %s\n", fname->base_name));
+       DBG_DEBUG("Path [%s]\n", fsp_str_dbg(fsp));
 
        if (config->wipe_intentionally_left_blank_rfork) {
                conv_flags |= AD_CONV_WIPE_BLANK;
@@ -4220,9 +4223,9 @@ static NTSTATUS fruit_readdir_attr(struct 
vfs_handle_struct *handle,
        }
 
        ret = ad_convert(handle,
-                       fname,
-                       macos_string_replace_map,
-                       conv_flags);
+                        fsp->fsp_name,
+                        macos_string_replace_map,
+                        conv_flags);
        if (ret != 0) {
                DBG_ERR("ad_convert() failed\n");
                return NT_STATUS_UNSUCCESSFUL;
@@ -4230,7 +4233,7 @@ static NTSTATUS fruit_readdir_attr(struct 
vfs_handle_struct *handle,
 
        *pattr_data = talloc_zero(mem_ctx, struct readdir_attr_data);
        if (*pattr_data == NULL) {
-               return NT_STATUS_UNSUCCESSFUL;
+               return NT_STATUS_NO_MEMORY;
        }
        attr_data = *pattr_data;
        attr_data->type = RDATTR_AAPL;
@@ -4239,7 +4242,7 @@ static NTSTATUS fruit_readdir_attr(struct 
vfs_handle_struct *handle,
         * Mac metadata: compressed FinderInfo, resource fork length
         * and creation date
         */
-       status = readdir_attr_macmeta(handle, fname, attr_data);
+       status = readdir_attr_macmeta(handle, fsp->fsp_name, attr_data);
        if (!NT_STATUS_IS_OK(status)) {
                /*
                 * Error handling is tricky: if we return failure from
@@ -4256,7 +4259,8 @@ static NTSTATUS fruit_readdir_attr(struct 
vfs_handle_struct *handle,
         * UNIX mode
         */
        if (config->unix_info_enabled) {
-               attr_data->attr_data.aapl.unix_mode = fname->st.st_ex_mode;
+               attr_data->attr_data.aapl.unix_mode =
+                       fsp->fsp_name->st.st_ex_mode;
        }
 
        /*
@@ -4268,7 +4272,7 @@ static NTSTATUS fruit_readdir_attr(struct 
vfs_handle_struct *handle,
                status = smbd_calculate_access_mask(
                        handle->conn,
                        handle->conn->cwd_fsp,
-                       fname,
+                       fsp->fsp_name,
                        false,
                        SEC_FLAG_MAXIMUM_ALLOWED,
                        &attr_data->attr_data.aapl.max_access);
@@ -4280,8 +4284,8 @@ static NTSTATUS fruit_readdir_attr(struct 
vfs_handle_struct *handle,
        return NT_STATUS_OK;
 
 fail:
-       DEBUG(1, ("fruit_readdir_attr %s, error: %s\n",
-                 fname->base_name, nt_errstr(status)));
+       DBG_WARNING("Path [%s], error: %s\n", fsp_str_dbg(fsp),
+                  nt_errstr(status));
        TALLOC_FREE(*pattr_data);
        return status;
 }
@@ -5214,7 +5218,7 @@ static struct vfs_fn_pointers vfs_fruit_fns = {
        .ftruncate_fn = fruit_ftruncate,
        .fallocate_fn = fruit_fallocate,
        .create_file_fn = fruit_create_file,
-       .readdir_attr_fn = fruit_readdir_attr,
+       .freaddir_attr_fn = fruit_freaddir_attr,
        .offload_read_send_fn = fruit_offload_read_send,
        .offload_read_recv_fn = fruit_offload_read_recv,
        .offload_write_send_fn = fruit_offload_write_send,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index f1ded4fff04..508ef491af3 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -225,7 +225,7 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_DURABLE_DISCONNECT,
        SMB_VFS_OP_DURABLE_RECONNECT,
 
-       SMB_VFS_OP_READDIR_ATTR,
+       SMB_VFS_OP_FREADDIR_ATTR,
 
        /* This should always be last enum value */
 
@@ -347,7 +347,7 @@ static struct {
        { SMB_VFS_OP_DURABLE_COOKIE, "durable_cookie" },
        { SMB_VFS_OP_DURABLE_DISCONNECT, "durable_disconnect" },
        { SMB_VFS_OP_DURABLE_RECONNECT, "durable_reconnect" },
-       { SMB_VFS_OP_READDIR_ATTR,      "readdir_attr" },
+       { SMB_VFS_OP_FREADDIR_ATTR,      "freaddir_attr" },
        { SMB_VFS_OP_LAST, NULL }
 };
 
@@ -2260,17 +2260,20 @@ static NTSTATUS 
smb_full_audit_set_compression(vfs_handle_struct *handle,
        return result;
 }
 
-static NTSTATUS smb_full_audit_readdir_attr(struct vfs_handle_struct *handle,
-                                           const struct smb_filename *fname,
-                                           TALLOC_CTX *mem_ctx,
-                                           struct readdir_attr_data 
**pattr_data)
+static NTSTATUS smb_full_audit_freaddir_attr(struct vfs_handle_struct *handle,
+                                       struct files_struct *fsp,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct readdir_attr_data **pattr_data)
 {
        NTSTATUS status;
 
-       status = SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data);
+       status = SMB_VFS_NEXT_FREADDIR_ATTR(handle, fsp, mem_ctx, pattr_data);
 
-       do_log(SMB_VFS_OP_READDIR_ATTR, NT_STATUS_IS_OK(status), handle, "%s",
-              smb_fname_str_do_log(handle->conn, fname));
+       do_log(SMB_VFS_OP_FREADDIR_ATTR,
+              NT_STATUS_IS_OK(status),
+              handle,
+              "%s",
+              fsp_str_do_log(fsp));
 
        return status;
 }
@@ -3013,8 +3016,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .durable_cookie_fn = smb_full_audit_durable_cookie,
        .durable_disconnect_fn = smb_full_audit_durable_disconnect,
        .durable_reconnect_fn = smb_full_audit_durable_reconnect,
-       .readdir_attr_fn = smb_full_audit_readdir_attr
-
+       .freaddir_attr_fn = smb_full_audit_freaddir_attr,
 };
 
 static_decl_vfs;
diff --git a/source3/modules/vfs_not_implemented.c 
b/source3/modules/vfs_not_implemented.c
index c4722c3687d..b4139644fef 100644
--- a/source3/modules/vfs_not_implemented.c
+++ b/source3/modules/vfs_not_implemented.c
@@ -700,10 +700,10 @@ NTSTATUS vfs_not_implemented_fsctl(struct 
vfs_handle_struct *handle,
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
-NTSTATUS vfs_not_implemented_readdir_attr(struct vfs_handle_struct *handle,
-                                         const struct smb_filename *fname,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct readdir_attr_data **pattr_data)
+NTSTATUS vfs_not_implemented_freaddir_attr(struct vfs_handle_struct *handle,
+                                       struct files_struct *fsp,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct readdir_attr_data **pattr_data)
 {
        return NT_STATUS_NOT_IMPLEMENTED;
 }
@@ -1068,7 +1068,7 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .strict_lock_check_fn = vfs_not_implemented_strict_lock_check,
        .translate_name_fn = vfs_not_implemented_translate_name,
        .fsctl_fn = vfs_not_implemented_fsctl,
-       .readdir_attr_fn = vfs_not_implemented_readdir_attr,
+       .freaddir_attr_fn = vfs_not_implemented_freaddir_attr,
        .audit_file_fn = vfs_not_implemented_audit_file,
 
        /* DOS attributes. */
diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c
index 7cd9bf0ae25..972fec54564 100644
--- a/source3/modules/vfs_time_audit.c
+++ b/source3/modules/vfs_time_audit.c
@@ -2194,22 +2194,22 @@ static NTSTATUS 
smb_time_audit_set_compression(vfs_handle_struct *handle,
        return result;
 }
 
-static NTSTATUS smb_time_audit_readdir_attr(struct vfs_handle_struct *handle,
-                                           const struct smb_filename *fname,
-                                           TALLOC_CTX *mem_ctx,
-                                           struct readdir_attr_data 
**pattr_data)
+static NTSTATUS smb_time_audit_freaddir_attr(struct vfs_handle_struct *handle,
+                                       struct files_struct *fsp,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct readdir_attr_data **pattr_data)
 {
        NTSTATUS status;
-       struct timespec ts1,ts2;
+       struct timespec ts1, ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       status = SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data);
+       status = SMB_VFS_NEXT_FREADDIR_ATTR(handle, fsp, mem_ctx, pattr_data);
        clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+       timediff = nsec_time_diff(&ts2, &ts1) * 1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_smb_fname("readdir_attr", timediff, fname);
+               smb_time_audit_log_fsp("freaddir_attr", timediff, fsp);
        }
 
        return status;


-- 
Samba Shared Repository

Reply via email to