]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: Implement create_dfs_pathat() in time_audit.
authorJeremy Allison <jra@samba.org>
Thu, 9 Jan 2020 21:36:08 +0000 (13:36 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 10 Jan 2020 19:38:42 +0000 (19:38 +0000)
Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/modules/vfs_time_audit.c

index da99a06ce3a53b3bcf2e43b40444c00b7ce9d468..9f20fc5234a27b8efa9867aa1226f4db3e1013c3 100644 (file)
@@ -323,6 +323,32 @@ static NTSTATUS smb_time_audit_get_dfs_referrals(
        return result;
 }
 
+static NTSTATUS smb_time_audit_create_dfs_pathat(struct vfs_handle_struct *handle,
+                       struct files_struct *dirfsp,
+                       const struct smb_filename *smb_fname,
+                       const struct referral *reflist,
+                       size_t referral_count)
+{
+       NTSTATUS result;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       result = SMB_VFS_NEXT_CREATE_DFS_PATHAT(handle,
+                       dirfsp,
+                       smb_fname,
+                       reflist,
+                       referral_count);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log("get_dfs_referrals", timediff);
+       }
+
+       return result;
+}
+
 static NTSTATUS smb_time_audit_snap_check_path(struct vfs_handle_struct *handle,
                                               TALLOC_CTX *mem_ctx,
                                               const char *service_path,
@@ -2807,6 +2833,7 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .statvfs_fn = smb_time_audit_statvfs,
        .fs_capabilities_fn = smb_time_audit_fs_capabilities,
        .get_dfs_referrals_fn = smb_time_audit_get_dfs_referrals,
+       .create_dfs_pathat_fn = smb_time_audit_create_dfs_pathat,
        .opendir_fn = smb_time_audit_opendir,
        .fdopendir_fn = smb_time_audit_fdopendir,
        .readdir_fn = smb_time_audit_readdir,