summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2020-02-14 13:08:04 -0800
committerRalph Boehme <slow@samba.org>2020-02-18 21:08:33 +0000
commit0528584482f798753d636675da778917f50ca845 (patch)
tree9f74eaadc9bb1eb3669550b57858a072dbf8d74a
parent263df988831a40ba751b19c1715277e80095818c (diff)
downloadsamba-0528584482f798753d636675da778917f50ca845.tar.gz
s3: VFS: vfs_time_audit: Add read_dfs_pathat().
Not yet used. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r--source3/modules/vfs_time_audit.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c
index 9f20fc5234a..5548f771fa5 100644
--- a/source3/modules/vfs_time_audit.c
+++ b/source3/modules/vfs_time_audit.c
@@ -349,6 +349,34 @@ static NTSTATUS smb_time_audit_create_dfs_pathat(struct vfs_handle_struct *handl
return result;
}
+static NTSTATUS smb_time_audit_read_dfs_pathat(struct vfs_handle_struct *handle,
+ TALLOC_CTX *mem_ctx,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ struct referral **ppreflist,
+ size_t *preferral_count)
+{
+ NTSTATUS result;
+ struct timespec ts1,ts2;
+ double timediff;
+
+ clock_gettime_mono(&ts1);
+ result = SMB_VFS_NEXT_READ_DFS_PATHAT(handle,
+ mem_ctx,
+ dirfsp,
+ smb_fname,
+ ppreflist,
+ preferral_count);
+ clock_gettime_mono(&ts2);
+ timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+ if (timediff > audit_timeout) {
+ smb_time_audit_log("read_dfs_pathat", timediff);
+ }
+
+ return result;
+}
+
static NTSTATUS smb_time_audit_snap_check_path(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
const char *service_path,
@@ -2834,6 +2862,7 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
.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,
+ .read_dfs_pathat_fn = smb_time_audit_read_dfs_pathat,
.opendir_fn = smb_time_audit_opendir,
.fdopendir_fn = smb_time_audit_fdopendir,
.readdir_fn = smb_time_audit_readdir,