2 * Time auditing VFS module for samba. Log time taken for VFS call to syslog
5 * Copyright (C) Abhidnya Chirmule <achirmul@in.ibm.com> 2009
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <http://www.gnu.org/licenses/>.
22 * This module implements logging for time taken for all Samba VFS operations.
24 * vfs objects = time_audit
29 #include "smbd/smbd.h"
33 #define DBGC_CLASS DBGC_VFS
35 static double audit_timeout
;
37 static void smb_time_audit_log(const char *syscallname
, double elapsed
)
39 DEBUG(0, ("WARNING: System call \"%s\" took unexpectedly long "
40 "(%.2f seconds) -- Validate that file and storage "
41 "subsystems are operating normally\n", syscallname
,
45 static int smb_time_audit_connect(vfs_handle_struct
*handle
,
46 const char *svc
, const char *user
)
49 struct timespec ts1
,ts2
;
56 clock_gettime_mono(&ts1
);
57 result
= SMB_VFS_NEXT_CONNECT(handle
, svc
, user
);
58 clock_gettime_mono(&ts2
);
59 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
60 if (timediff
> audit_timeout
) {
61 smb_time_audit_log("connect", timediff
);
66 static void smb_time_audit_disconnect(vfs_handle_struct
*handle
)
68 struct timespec ts1
,ts2
;
71 clock_gettime_mono(&ts1
);
72 SMB_VFS_NEXT_DISCONNECT(handle
);
73 clock_gettime_mono(&ts2
);
74 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
76 if (timediff
> audit_timeout
) {
77 smb_time_audit_log("disconnect", timediff
);
83 static uint64_t smb_time_audit_disk_free(vfs_handle_struct
*handle
,
85 bool small_query
, uint64_t *bsize
,
86 uint64_t *dfree
, uint64_t *dsize
)
89 struct timespec ts1
,ts2
;
92 clock_gettime_mono(&ts1
);
93 result
= SMB_VFS_NEXT_DISK_FREE(handle
, path
, small_query
, bsize
,
95 clock_gettime_mono(&ts2
);
96 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
98 /* Don't have a reasonable notion of failure here */
99 if (timediff
> audit_timeout
) {
100 smb_time_audit_log("disk_free", timediff
);
106 static int smb_time_audit_get_quota(struct vfs_handle_struct
*handle
,
107 enum SMB_QUOTA_TYPE qtype
, unid_t id
,
111 struct timespec ts1
,ts2
;
114 clock_gettime_mono(&ts1
);
115 result
= SMB_VFS_NEXT_GET_QUOTA(handle
, qtype
, id
, qt
);
116 clock_gettime_mono(&ts2
);
117 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
119 if (timediff
> audit_timeout
) {
120 smb_time_audit_log("get_quota", timediff
);
125 static int smb_time_audit_set_quota(struct vfs_handle_struct
*handle
,
126 enum SMB_QUOTA_TYPE qtype
, unid_t id
,
130 struct timespec ts1
,ts2
;
133 clock_gettime_mono(&ts1
);
134 result
= SMB_VFS_NEXT_SET_QUOTA(handle
, qtype
, id
, qt
);
135 clock_gettime_mono(&ts2
);
136 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
138 if (timediff
> audit_timeout
) {
139 smb_time_audit_log("set_quota", timediff
);
145 static int smb_time_audit_get_shadow_copy_data(struct vfs_handle_struct
*handle
,
146 struct files_struct
*fsp
,
147 struct shadow_copy_data
*shadow_copy_data
,
151 struct timespec ts1
,ts2
;
154 clock_gettime_mono(&ts1
);
155 result
= SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle
, fsp
,
156 shadow_copy_data
, labels
);
157 clock_gettime_mono(&ts2
);
158 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
160 if (timediff
> audit_timeout
) {
161 smb_time_audit_log("get_shadow_copy_data", timediff
);
167 static int smb_time_audit_statvfs(struct vfs_handle_struct
*handle
,
169 struct vfs_statvfs_struct
*statbuf
)
172 struct timespec ts1
,ts2
;
175 clock_gettime_mono(&ts1
);
176 result
= SMB_VFS_NEXT_STATVFS(handle
, path
, statbuf
);
177 clock_gettime_mono(&ts2
);
178 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
180 if (timediff
> audit_timeout
) {
181 smb_time_audit_log("statvfs", timediff
);
187 static uint32_t smb_time_audit_fs_capabilities(struct vfs_handle_struct
*handle
,
188 enum timestamp_set_resolution
*p_ts_res
)
191 struct timespec ts1
,ts2
;
194 clock_gettime_mono(&ts1
);
195 result
= SMB_VFS_NEXT_FS_CAPABILITIES(handle
, p_ts_res
);
196 clock_gettime_mono(&ts2
);
197 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
199 if (timediff
> audit_timeout
) {
200 smb_time_audit_log("fs_capabilities", timediff
);
206 static DIR *smb_time_audit_opendir(vfs_handle_struct
*handle
,
208 const char *mask
, uint32 attr
)
211 struct timespec ts1
,ts2
;
214 clock_gettime_mono(&ts1
);
215 result
= SMB_VFS_NEXT_OPENDIR(handle
, fname
, mask
, attr
);
216 clock_gettime_mono(&ts2
);
217 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
219 if (timediff
> audit_timeout
) {
220 smb_time_audit_log("opendir", timediff
);
226 static DIR *smb_time_audit_fdopendir(vfs_handle_struct
*handle
,
228 const char *mask
, uint32 attr
)
231 struct timespec ts1
,ts2
;
234 clock_gettime_mono(&ts1
);
235 result
= SMB_VFS_NEXT_FDOPENDIR(handle
, fsp
, mask
, attr
);
236 clock_gettime_mono(&ts2
);
237 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
239 if (timediff
> audit_timeout
) {
240 smb_time_audit_log("fdopendir", timediff
);
246 static struct dirent
*smb_time_audit_readdir(vfs_handle_struct
*handle
,
248 SMB_STRUCT_STAT
*sbuf
)
250 struct dirent
*result
;
251 struct timespec ts1
,ts2
;
254 clock_gettime_mono(&ts1
);
255 result
= SMB_VFS_NEXT_READDIR(handle
, dirp
, sbuf
);
256 clock_gettime_mono(&ts2
);
257 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
259 if (timediff
> audit_timeout
) {
260 smb_time_audit_log("readdir", timediff
);
266 static void smb_time_audit_seekdir(vfs_handle_struct
*handle
,
267 DIR *dirp
, long offset
)
269 struct timespec ts1
,ts2
;
272 clock_gettime_mono(&ts1
);
273 SMB_VFS_NEXT_SEEKDIR(handle
, dirp
, offset
);
274 clock_gettime_mono(&ts2
);
275 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
277 if (timediff
> audit_timeout
) {
278 smb_time_audit_log("seekdir", timediff
);
284 static long smb_time_audit_telldir(vfs_handle_struct
*handle
,
288 struct timespec ts1
,ts2
;
291 clock_gettime_mono(&ts1
);
292 result
= SMB_VFS_NEXT_TELLDIR(handle
, dirp
);
293 clock_gettime_mono(&ts2
);
294 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
296 if (timediff
> audit_timeout
) {
297 smb_time_audit_log("telldir", timediff
);
303 static void smb_time_audit_rewinddir(vfs_handle_struct
*handle
,
306 struct timespec ts1
,ts2
;
309 clock_gettime_mono(&ts1
);
310 SMB_VFS_NEXT_REWINDDIR(handle
, dirp
);
311 clock_gettime_mono(&ts2
);
312 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
314 if (timediff
> audit_timeout
) {
315 smb_time_audit_log("rewinddir", timediff
);
321 static int smb_time_audit_mkdir(vfs_handle_struct
*handle
,
322 const char *path
, mode_t mode
)
325 struct timespec ts1
,ts2
;
328 clock_gettime_mono(&ts1
);
329 result
= SMB_VFS_NEXT_MKDIR(handle
, path
, mode
);
330 clock_gettime_mono(&ts2
);
331 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
333 if (timediff
> audit_timeout
) {
334 smb_time_audit_log("mkdir", timediff
);
340 static int smb_time_audit_rmdir(vfs_handle_struct
*handle
,
344 struct timespec ts1
,ts2
;
347 clock_gettime_mono(&ts1
);
348 result
= SMB_VFS_NEXT_RMDIR(handle
, path
);
349 clock_gettime_mono(&ts2
);
350 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
352 if (timediff
> audit_timeout
) {
353 smb_time_audit_log("rmdir", timediff
);
359 static int smb_time_audit_closedir(vfs_handle_struct
*handle
,
363 struct timespec ts1
,ts2
;
366 clock_gettime_mono(&ts1
);
367 result
= SMB_VFS_NEXT_CLOSEDIR(handle
, dirp
);
368 clock_gettime_mono(&ts2
);
369 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
371 if (timediff
> audit_timeout
) {
372 smb_time_audit_log("closedir", timediff
);
378 static void smb_time_audit_init_search_op(vfs_handle_struct
*handle
,
381 struct timespec ts1
,ts2
;
384 clock_gettime_mono(&ts1
);
385 SMB_VFS_NEXT_INIT_SEARCH_OP(handle
, dirp
);
386 clock_gettime_mono(&ts2
);
387 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
389 if (timediff
> audit_timeout
) {
390 smb_time_audit_log("init_search_op", timediff
);
395 static int smb_time_audit_open(vfs_handle_struct
*handle
,
396 struct smb_filename
*fname
,
398 int flags
, mode_t mode
)
401 struct timespec ts1
,ts2
;
404 clock_gettime_mono(&ts1
);
405 result
= SMB_VFS_NEXT_OPEN(handle
, fname
, fsp
, flags
, mode
);
406 clock_gettime_mono(&ts2
);
407 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
409 if (timediff
> audit_timeout
) {
410 smb_time_audit_log("open", timediff
);
416 static NTSTATUS
smb_time_audit_create_file(vfs_handle_struct
*handle
,
417 struct smb_request
*req
,
418 uint16_t root_dir_fid
,
419 struct smb_filename
*fname
,
420 uint32_t access_mask
,
421 uint32_t share_access
,
422 uint32_t create_disposition
,
423 uint32_t create_options
,
424 uint32_t file_attributes
,
425 uint32_t oplock_request
,
426 uint64_t allocation_size
,
427 uint32_t private_flags
,
428 struct security_descriptor
*sd
,
429 struct ea_list
*ea_list
,
430 files_struct
**result_fsp
,
434 struct timespec ts1
,ts2
;
437 clock_gettime_mono(&ts1
);
438 result
= SMB_VFS_NEXT_CREATE_FILE(
441 root_dir_fid
, /* root_dir_fid */
443 access_mask
, /* access_mask */
444 share_access
, /* share_access */
445 create_disposition
, /* create_disposition*/
446 create_options
, /* create_options */
447 file_attributes
, /* file_attributes */
448 oplock_request
, /* oplock_request */
449 allocation_size
, /* allocation_size */
452 ea_list
, /* ea_list */
453 result_fsp
, /* result */
455 clock_gettime_mono(&ts2
);
456 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
458 if (timediff
> audit_timeout
) {
459 smb_time_audit_log("create_file", timediff
);
465 static int smb_time_audit_close(vfs_handle_struct
*handle
, files_struct
*fsp
)
468 struct timespec ts1
,ts2
;
471 clock_gettime_mono(&ts1
);
472 result
= SMB_VFS_NEXT_CLOSE(handle
, fsp
);
473 clock_gettime_mono(&ts2
);
474 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
476 if (timediff
> audit_timeout
) {
477 smb_time_audit_log("close", timediff
);
483 static ssize_t
smb_time_audit_read(vfs_handle_struct
*handle
,
484 files_struct
*fsp
, void *data
, size_t n
)
487 struct timespec ts1
,ts2
;
490 clock_gettime_mono(&ts1
);
491 result
= SMB_VFS_NEXT_READ(handle
, fsp
, data
, n
);
492 clock_gettime_mono(&ts2
);
493 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
495 if (timediff
> audit_timeout
) {
496 smb_time_audit_log("read", timediff
);
502 static ssize_t
smb_time_audit_pread(vfs_handle_struct
*handle
,
504 void *data
, size_t n
, off_t offset
)
507 struct timespec ts1
,ts2
;
510 clock_gettime_mono(&ts1
);
511 result
= SMB_VFS_NEXT_PREAD(handle
, fsp
, data
, n
, offset
);
512 clock_gettime_mono(&ts2
);
513 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
515 if (timediff
> audit_timeout
) {
516 smb_time_audit_log("pread", timediff
);
522 static ssize_t
smb_time_audit_write(vfs_handle_struct
*handle
,
524 const void *data
, size_t n
)
527 struct timespec ts1
,ts2
;
530 clock_gettime_mono(&ts1
);
531 result
= SMB_VFS_NEXT_WRITE(handle
, fsp
, data
, n
);
532 clock_gettime_mono(&ts2
);
533 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
535 if (timediff
> audit_timeout
) {
536 smb_time_audit_log("write", timediff
);
542 static ssize_t
smb_time_audit_pwrite(vfs_handle_struct
*handle
,
544 const void *data
, size_t n
,
548 struct timespec ts1
,ts2
;
551 clock_gettime_mono(&ts1
);
552 result
= SMB_VFS_NEXT_PWRITE(handle
, fsp
, data
, n
, offset
);
553 clock_gettime_mono(&ts2
);
554 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
556 if (timediff
> audit_timeout
) {
557 smb_time_audit_log("pwrite", timediff
);
563 static off_t
smb_time_audit_lseek(vfs_handle_struct
*handle
,
565 off_t offset
, int whence
)
568 struct timespec ts1
,ts2
;
571 clock_gettime_mono(&ts1
);
572 result
= SMB_VFS_NEXT_LSEEK(handle
, fsp
, offset
, whence
);
573 clock_gettime_mono(&ts2
);
574 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
576 if (timediff
> audit_timeout
) {
577 smb_time_audit_log("lseek", timediff
);
583 static ssize_t
smb_time_audit_sendfile(vfs_handle_struct
*handle
, int tofd
,
584 files_struct
*fromfsp
,
585 const DATA_BLOB
*hdr
, off_t offset
,
589 struct timespec ts1
,ts2
;
592 clock_gettime_mono(&ts1
);
593 result
= SMB_VFS_NEXT_SENDFILE(handle
, tofd
, fromfsp
, hdr
, offset
, n
);
594 clock_gettime_mono(&ts2
);
595 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
597 if (timediff
> audit_timeout
) {
598 smb_time_audit_log("sendfile", timediff
);
604 static ssize_t
smb_time_audit_recvfile(vfs_handle_struct
*handle
, int fromfd
,
610 struct timespec ts1
,ts2
;
613 clock_gettime_mono(&ts1
);
614 result
= SMB_VFS_NEXT_RECVFILE(handle
, fromfd
, tofsp
, offset
, n
);
615 clock_gettime_mono(&ts2
);
616 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
618 if (timediff
> audit_timeout
) {
619 smb_time_audit_log("recvfile", timediff
);
625 static int smb_time_audit_rename(vfs_handle_struct
*handle
,
626 const struct smb_filename
*oldname
,
627 const struct smb_filename
*newname
)
630 struct timespec ts1
,ts2
;
633 clock_gettime_mono(&ts1
);
634 result
= SMB_VFS_NEXT_RENAME(handle
, oldname
, newname
);
635 clock_gettime_mono(&ts2
);
636 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
638 if (timediff
> audit_timeout
) {
639 smb_time_audit_log("rename", timediff
);
645 static int smb_time_audit_fsync(vfs_handle_struct
*handle
, files_struct
*fsp
)
648 struct timespec ts1
,ts2
;
651 clock_gettime_mono(&ts1
);
652 result
= SMB_VFS_NEXT_FSYNC(handle
, fsp
);
653 clock_gettime_mono(&ts2
);
654 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
656 if (timediff
> audit_timeout
) {
657 smb_time_audit_log("fsync", timediff
);
663 static int smb_time_audit_stat(vfs_handle_struct
*handle
,
664 struct smb_filename
*fname
)
667 struct timespec ts1
,ts2
;
670 clock_gettime_mono(&ts1
);
671 result
= SMB_VFS_NEXT_STAT(handle
, fname
);
672 clock_gettime_mono(&ts2
);
673 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
675 if (timediff
> audit_timeout
) {
676 smb_time_audit_log("stat", timediff
);
682 static int smb_time_audit_fstat(vfs_handle_struct
*handle
, files_struct
*fsp
,
683 SMB_STRUCT_STAT
*sbuf
)
686 struct timespec ts1
,ts2
;
689 clock_gettime_mono(&ts1
);
690 result
= SMB_VFS_NEXT_FSTAT(handle
, fsp
, sbuf
);
691 clock_gettime_mono(&ts2
);
692 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
694 if (timediff
> audit_timeout
) {
695 smb_time_audit_log("fstat", timediff
);
701 static int smb_time_audit_lstat(vfs_handle_struct
*handle
,
702 struct smb_filename
*path
)
705 struct timespec ts1
,ts2
;
708 clock_gettime_mono(&ts1
);
709 result
= SMB_VFS_NEXT_LSTAT(handle
, path
);
710 clock_gettime_mono(&ts2
);
711 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
713 if (timediff
> audit_timeout
) {
714 smb_time_audit_log("lstat", timediff
);
720 static uint64_t smb_time_audit_get_alloc_size(vfs_handle_struct
*handle
,
722 const SMB_STRUCT_STAT
*sbuf
)
725 struct timespec ts1
,ts2
;
728 clock_gettime_mono(&ts1
);
729 result
= SMB_VFS_NEXT_GET_ALLOC_SIZE(handle
, fsp
, sbuf
);
730 clock_gettime_mono(&ts2
);
731 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
733 if (timediff
> audit_timeout
) {
734 smb_time_audit_log("get_alloc_size", timediff
);
740 static int smb_time_audit_unlink(vfs_handle_struct
*handle
,
741 const struct smb_filename
*path
)
744 struct timespec ts1
,ts2
;
747 clock_gettime_mono(&ts1
);
748 result
= SMB_VFS_NEXT_UNLINK(handle
, path
);
749 clock_gettime_mono(&ts2
);
750 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
752 if (timediff
> audit_timeout
) {
753 smb_time_audit_log("unlink", timediff
);
759 static int smb_time_audit_chmod(vfs_handle_struct
*handle
,
760 const char *path
, mode_t mode
)
763 struct timespec ts1
,ts2
;
766 clock_gettime_mono(&ts1
);
767 result
= SMB_VFS_NEXT_CHMOD(handle
, path
, mode
);
768 clock_gettime_mono(&ts2
);
769 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
771 if (timediff
> audit_timeout
) {
772 smb_time_audit_log("chmod", timediff
);
778 static int smb_time_audit_fchmod(vfs_handle_struct
*handle
, files_struct
*fsp
,
782 struct timespec ts1
,ts2
;
785 clock_gettime_mono(&ts1
);
786 result
= SMB_VFS_NEXT_FCHMOD(handle
, fsp
, mode
);
787 clock_gettime_mono(&ts2
);
788 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
790 if (timediff
> audit_timeout
) {
791 smb_time_audit_log("fchmod", timediff
);
797 static int smb_time_audit_chown(vfs_handle_struct
*handle
,
798 const char *path
, uid_t uid
, gid_t gid
)
801 struct timespec ts1
,ts2
;
804 clock_gettime_mono(&ts1
);
805 result
= SMB_VFS_NEXT_CHOWN(handle
, path
, uid
, gid
);
806 clock_gettime_mono(&ts2
);
807 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
809 if (timediff
> audit_timeout
) {
810 smb_time_audit_log("chown", timediff
);
816 static int smb_time_audit_fchown(vfs_handle_struct
*handle
, files_struct
*fsp
,
817 uid_t uid
, gid_t gid
)
820 struct timespec ts1
,ts2
;
823 clock_gettime_mono(&ts1
);
824 result
= SMB_VFS_NEXT_FCHOWN(handle
, fsp
, uid
, gid
);
825 clock_gettime_mono(&ts2
);
826 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
828 if (timediff
> audit_timeout
) {
829 smb_time_audit_log("fchown", timediff
);
835 static int smb_time_audit_lchown(vfs_handle_struct
*handle
,
836 const char *path
, uid_t uid
, gid_t gid
)
839 struct timespec ts1
,ts2
;
842 clock_gettime_mono(&ts1
);
843 result
= SMB_VFS_NEXT_LCHOWN(handle
, path
, uid
, gid
);
844 clock_gettime_mono(&ts2
);
845 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
847 if (timediff
> audit_timeout
) {
848 smb_time_audit_log("lchown", timediff
);
854 static int smb_time_audit_chdir(vfs_handle_struct
*handle
, const char *path
)
857 struct timespec ts1
,ts2
;
860 clock_gettime_mono(&ts1
);
861 result
= SMB_VFS_NEXT_CHDIR(handle
, path
);
862 clock_gettime_mono(&ts2
);
863 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
865 if (timediff
> audit_timeout
) {
866 smb_time_audit_log("chdir", timediff
);
872 static char *smb_time_audit_getwd(vfs_handle_struct
*handle
)
875 struct timespec ts1
,ts2
;
878 clock_gettime_mono(&ts1
);
879 result
= SMB_VFS_NEXT_GETWD(handle
);
880 clock_gettime_mono(&ts2
);
881 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
883 if (timediff
> audit_timeout
) {
884 smb_time_audit_log("getwd", timediff
);
890 static int smb_time_audit_ntimes(vfs_handle_struct
*handle
,
891 const struct smb_filename
*path
,
892 struct smb_file_time
*ft
)
895 struct timespec ts1
,ts2
;
898 clock_gettime_mono(&ts1
);
899 result
= SMB_VFS_NEXT_NTIMES(handle
, path
, ft
);
900 clock_gettime_mono(&ts2
);
901 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
903 if (timediff
> audit_timeout
) {
904 smb_time_audit_log("ntimes", timediff
);
910 static int smb_time_audit_ftruncate(vfs_handle_struct
*handle
,
915 struct timespec ts1
,ts2
;
918 clock_gettime_mono(&ts1
);
919 result
= SMB_VFS_NEXT_FTRUNCATE(handle
, fsp
, len
);
920 clock_gettime_mono(&ts2
);
921 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
923 if (timediff
> audit_timeout
) {
924 smb_time_audit_log("ftruncate", timediff
);
930 static int smb_time_audit_fallocate(vfs_handle_struct
*handle
,
932 enum vfs_fallocate_mode mode
,
937 struct timespec ts1
,ts2
;
940 clock_gettime_mono(&ts1
);
941 result
= SMB_VFS_NEXT_FALLOCATE(handle
, fsp
, mode
, offset
, len
);
942 clock_gettime_mono(&ts2
);
943 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
945 if (timediff
> audit_timeout
) {
946 smb_time_audit_log("fallocate", timediff
);
952 static bool smb_time_audit_lock(vfs_handle_struct
*handle
, files_struct
*fsp
,
953 int op
, off_t offset
, off_t count
,
957 struct timespec ts1
,ts2
;
960 clock_gettime_mono(&ts1
);
961 result
= SMB_VFS_NEXT_LOCK(handle
, fsp
, op
, offset
, count
, type
);
962 clock_gettime_mono(&ts2
);
963 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
965 if (timediff
> audit_timeout
) {
966 smb_time_audit_log("lock", timediff
);
972 static int smb_time_audit_kernel_flock(struct vfs_handle_struct
*handle
,
973 struct files_struct
*fsp
,
974 uint32 share_mode
, uint32 access_mask
)
977 struct timespec ts1
,ts2
;
980 clock_gettime_mono(&ts1
);
981 result
= SMB_VFS_NEXT_KERNEL_FLOCK(handle
, fsp
, share_mode
,
983 clock_gettime_mono(&ts2
);
984 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
986 if (timediff
> audit_timeout
) {
987 smb_time_audit_log("kernel_flock", timediff
);
993 static int smb_time_audit_linux_setlease(vfs_handle_struct
*handle
,
998 struct timespec ts1
,ts2
;
1001 clock_gettime_mono(&ts1
);
1002 result
= SMB_VFS_NEXT_LINUX_SETLEASE(handle
, fsp
, leasetype
);
1003 clock_gettime_mono(&ts2
);
1004 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1006 if (timediff
> audit_timeout
) {
1007 smb_time_audit_log("linux_setlease", timediff
);
1013 static bool smb_time_audit_getlock(vfs_handle_struct
*handle
,
1015 off_t
*poffset
, off_t
*pcount
,
1016 int *ptype
, pid_t
*ppid
)
1019 struct timespec ts1
,ts2
;
1022 clock_gettime_mono(&ts1
);
1023 result
= SMB_VFS_NEXT_GETLOCK(handle
, fsp
, poffset
, pcount
, ptype
,
1025 clock_gettime_mono(&ts2
);
1026 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1028 if (timediff
> audit_timeout
) {
1029 smb_time_audit_log("getlock", timediff
);
1035 static int smb_time_audit_symlink(vfs_handle_struct
*handle
,
1036 const char *oldpath
, const char *newpath
)
1039 struct timespec ts1
,ts2
;
1042 clock_gettime_mono(&ts1
);
1043 result
= SMB_VFS_NEXT_SYMLINK(handle
, oldpath
, newpath
);
1044 clock_gettime_mono(&ts2
);
1045 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1047 if (timediff
> audit_timeout
) {
1048 smb_time_audit_log("symlink", timediff
);
1054 static int smb_time_audit_readlink(vfs_handle_struct
*handle
,
1055 const char *path
, char *buf
, size_t bufsiz
)
1058 struct timespec ts1
,ts2
;
1061 clock_gettime_mono(&ts1
);
1062 result
= SMB_VFS_NEXT_READLINK(handle
, path
, buf
, bufsiz
);
1063 clock_gettime_mono(&ts2
);
1064 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1066 if (timediff
> audit_timeout
) {
1067 smb_time_audit_log("readlink", timediff
);
1073 static int smb_time_audit_link(vfs_handle_struct
*handle
,
1074 const char *oldpath
, const char *newpath
)
1077 struct timespec ts1
,ts2
;
1080 clock_gettime_mono(&ts1
);
1081 result
= SMB_VFS_NEXT_LINK(handle
, oldpath
, newpath
);
1082 clock_gettime_mono(&ts2
);
1083 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1085 if (timediff
> audit_timeout
) {
1086 smb_time_audit_log("link", timediff
);
1092 static int smb_time_audit_mknod(vfs_handle_struct
*handle
,
1093 const char *pathname
, mode_t mode
,
1097 struct timespec ts1
,ts2
;
1100 clock_gettime_mono(&ts1
);
1101 result
= SMB_VFS_NEXT_MKNOD(handle
, pathname
, mode
, dev
);
1102 clock_gettime_mono(&ts2
);
1103 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1105 if (timediff
> audit_timeout
) {
1106 smb_time_audit_log("mknod", timediff
);
1112 static char *smb_time_audit_realpath(vfs_handle_struct
*handle
,
1116 struct timespec ts1
,ts2
;
1119 clock_gettime_mono(&ts1
);
1120 result
= SMB_VFS_NEXT_REALPATH(handle
, path
);
1121 clock_gettime_mono(&ts2
);
1122 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1124 if (timediff
> audit_timeout
) {
1125 smb_time_audit_log("realpath", timediff
);
1131 static NTSTATUS
smb_time_audit_notify_watch(struct vfs_handle_struct
*handle
,
1132 struct sys_notify_context
*ctx
,
1135 uint32_t *subdir_filter
,
1136 void (*callback
)(struct sys_notify_context
*ctx
,
1138 struct notify_event
*ev
),
1139 void *private_data
, void *handle_p
)
1142 struct timespec ts1
,ts2
;
1145 clock_gettime_mono(&ts1
);
1146 result
= SMB_VFS_NEXT_NOTIFY_WATCH(handle
, ctx
, path
,
1147 filter
, subdir_filter
, callback
,
1148 private_data
, handle_p
);
1149 clock_gettime_mono(&ts2
);
1150 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1152 if (timediff
> audit_timeout
) {
1153 smb_time_audit_log("notify_watch", timediff
);
1159 static int smb_time_audit_chflags(vfs_handle_struct
*handle
,
1160 const char *path
, unsigned int flags
)
1163 struct timespec ts1
,ts2
;
1166 clock_gettime_mono(&ts1
);
1167 result
= SMB_VFS_NEXT_CHFLAGS(handle
, path
, flags
);
1168 clock_gettime_mono(&ts2
);
1169 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1171 if (timediff
> audit_timeout
) {
1172 smb_time_audit_log("chflags", timediff
);
1178 static struct file_id
smb_time_audit_file_id_create(struct vfs_handle_struct
*handle
,
1179 const SMB_STRUCT_STAT
*sbuf
)
1181 struct file_id id_zero
;
1182 struct file_id result
;
1183 struct timespec ts1
,ts2
;
1186 ZERO_STRUCT(id_zero
);
1188 clock_gettime_mono(&ts1
);
1189 result
= SMB_VFS_NEXT_FILE_ID_CREATE(handle
, sbuf
);
1190 clock_gettime_mono(&ts2
);
1191 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1193 if (timediff
> audit_timeout
) {
1194 smb_time_audit_log("file_id_create", timediff
);
1200 static NTSTATUS
smb_time_audit_streaminfo(vfs_handle_struct
*handle
,
1201 struct files_struct
*fsp
,
1203 TALLOC_CTX
*mem_ctx
,
1204 unsigned int *pnum_streams
,
1205 struct stream_struct
**pstreams
)
1208 struct timespec ts1
,ts2
;
1211 clock_gettime_mono(&ts1
);
1212 result
= SMB_VFS_NEXT_STREAMINFO(handle
, fsp
, fname
, mem_ctx
,
1213 pnum_streams
, pstreams
);
1214 clock_gettime_mono(&ts2
);
1215 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1217 if (timediff
> audit_timeout
) {
1218 smb_time_audit_log("streaminfo", timediff
);
1224 static int smb_time_audit_get_real_filename(struct vfs_handle_struct
*handle
,
1227 TALLOC_CTX
*mem_ctx
,
1231 struct timespec ts1
,ts2
;
1234 clock_gettime_mono(&ts1
);
1235 result
= SMB_VFS_NEXT_GET_REAL_FILENAME(handle
, path
, name
, mem_ctx
,
1237 clock_gettime_mono(&ts2
);
1238 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1240 if (timediff
> audit_timeout
) {
1241 smb_time_audit_log("get_real_filename", timediff
);
1247 static const char *smb_time_audit_connectpath(vfs_handle_struct
*handle
,
1251 struct timespec ts1
,ts2
;
1254 clock_gettime_mono(&ts1
);
1255 result
= SMB_VFS_NEXT_CONNECTPATH(handle
, fname
);
1256 clock_gettime_mono(&ts2
);
1257 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1259 if (timediff
> audit_timeout
) {
1260 smb_time_audit_log("connectpath", timediff
);
1266 static NTSTATUS
smb_time_audit_brl_lock_windows(struct vfs_handle_struct
*handle
,
1267 struct byte_range_lock
*br_lck
,
1268 struct lock_struct
*plock
,
1270 struct blocking_lock_record
*blr
)
1273 struct timespec ts1
,ts2
;
1276 clock_gettime_mono(&ts1
);
1277 result
= SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle
, br_lck
, plock
,
1278 blocking_lock
, blr
);
1279 clock_gettime_mono(&ts2
);
1280 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1282 if (timediff
> audit_timeout
) {
1283 smb_time_audit_log("brl_lock_windows", timediff
);
1289 static bool smb_time_audit_brl_unlock_windows(struct vfs_handle_struct
*handle
,
1290 struct messaging_context
*msg_ctx
,
1291 struct byte_range_lock
*br_lck
,
1292 const struct lock_struct
*plock
)
1295 struct timespec ts1
,ts2
;
1298 clock_gettime_mono(&ts1
);
1299 result
= SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle
, msg_ctx
, br_lck
,
1301 clock_gettime_mono(&ts2
);
1302 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1304 if (timediff
> audit_timeout
) {
1305 smb_time_audit_log("brl_unlock_windows", timediff
);
1311 static bool smb_time_audit_brl_cancel_windows(struct vfs_handle_struct
*handle
,
1312 struct byte_range_lock
*br_lck
,
1313 struct lock_struct
*plock
,
1314 struct blocking_lock_record
*blr
)
1317 struct timespec ts1
,ts2
;
1320 clock_gettime_mono(&ts1
);
1321 result
= SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle
, br_lck
, plock
, blr
);
1322 clock_gettime_mono(&ts2
);
1323 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1325 if (timediff
> audit_timeout
) {
1326 smb_time_audit_log("brl_cancel_windows", timediff
);
1332 static bool smb_time_audit_strict_lock(struct vfs_handle_struct
*handle
,
1333 struct files_struct
*fsp
,
1334 struct lock_struct
*plock
)
1337 struct timespec ts1
,ts2
;
1340 clock_gettime_mono(&ts1
);
1341 result
= SMB_VFS_NEXT_STRICT_LOCK(handle
, fsp
, plock
);
1342 clock_gettime_mono(&ts2
);
1343 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1345 if (timediff
> audit_timeout
) {
1346 smb_time_audit_log("strict_lock", timediff
);
1352 static void smb_time_audit_strict_unlock(struct vfs_handle_struct
*handle
,
1353 struct files_struct
*fsp
,
1354 struct lock_struct
*plock
)
1356 struct timespec ts1
,ts2
;
1359 clock_gettime_mono(&ts1
);
1360 SMB_VFS_NEXT_STRICT_UNLOCK(handle
, fsp
, plock
);
1361 clock_gettime_mono(&ts2
);
1362 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1364 if (timediff
> audit_timeout
) {
1365 smb_time_audit_log("strict_unlock", timediff
);
1371 static NTSTATUS
smb_time_audit_translate_name(struct vfs_handle_struct
*handle
,
1373 enum vfs_translate_direction direction
,
1374 TALLOC_CTX
*mem_ctx
,
1378 struct timespec ts1
,ts2
;
1381 clock_gettime_mono(&ts1
);
1382 result
= SMB_VFS_NEXT_TRANSLATE_NAME(handle
, name
, direction
, mem_ctx
,
1384 clock_gettime_mono(&ts2
);
1385 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1387 if (timediff
> audit_timeout
) {
1388 smb_time_audit_log("translate_name", timediff
);
1394 static NTSTATUS
smb_time_audit_fget_nt_acl(vfs_handle_struct
*handle
,
1396 uint32 security_info
,
1397 struct security_descriptor
**ppdesc
)
1400 struct timespec ts1
,ts2
;
1403 clock_gettime_mono(&ts1
);
1404 result
= SMB_VFS_NEXT_FGET_NT_ACL(handle
, fsp
, security_info
, ppdesc
);
1405 clock_gettime_mono(&ts2
);
1406 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1408 if (timediff
> audit_timeout
) {
1409 smb_time_audit_log("fget_nt_acl", timediff
);
1415 static NTSTATUS
smb_time_audit_get_nt_acl(vfs_handle_struct
*handle
,
1417 uint32 security_info
,
1418 struct security_descriptor
**ppdesc
)
1421 struct timespec ts1
,ts2
;
1424 clock_gettime_mono(&ts1
);
1425 result
= SMB_VFS_NEXT_GET_NT_ACL(handle
, name
, security_info
, ppdesc
);
1426 clock_gettime_mono(&ts2
);
1427 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1429 if (timediff
> audit_timeout
) {
1430 smb_time_audit_log("get_nt_acl", timediff
);
1436 static NTSTATUS
smb_time_audit_fset_nt_acl(vfs_handle_struct
*handle
,
1438 uint32 security_info_sent
,
1439 const struct security_descriptor
*psd
)
1442 struct timespec ts1
,ts2
;
1445 clock_gettime_mono(&ts1
);
1446 result
= SMB_VFS_NEXT_FSET_NT_ACL(handle
, fsp
, security_info_sent
,
1448 clock_gettime_mono(&ts2
);
1449 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1451 if (timediff
> audit_timeout
) {
1452 smb_time_audit_log("fset_nt_acl", timediff
);
1458 static int smb_time_audit_chmod_acl(vfs_handle_struct
*handle
,
1459 const char *path
, mode_t mode
)
1462 struct timespec ts1
,ts2
;
1465 clock_gettime_mono(&ts1
);
1466 result
= SMB_VFS_NEXT_CHMOD_ACL(handle
, path
, mode
);
1467 clock_gettime_mono(&ts2
);
1468 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1470 if (timediff
> audit_timeout
) {
1471 smb_time_audit_log("chmod_acl", timediff
);
1477 static int smb_time_audit_fchmod_acl(vfs_handle_struct
*handle
,
1478 files_struct
*fsp
, mode_t mode
)
1481 struct timespec ts1
,ts2
;
1484 clock_gettime_mono(&ts1
);
1485 result
= SMB_VFS_NEXT_FCHMOD_ACL(handle
, fsp
, mode
);
1486 clock_gettime_mono(&ts2
);
1487 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1489 if (timediff
> audit_timeout
) {
1490 smb_time_audit_log("fchmod_acl", timediff
);
1496 static int smb_time_audit_sys_acl_get_entry(vfs_handle_struct
*handle
,
1497 SMB_ACL_T theacl
, int entry_id
,
1498 SMB_ACL_ENTRY_T
*entry_p
)
1501 struct timespec ts1
,ts2
;
1504 clock_gettime_mono(&ts1
);
1505 result
= SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle
, theacl
, entry_id
,
1507 clock_gettime_mono(&ts2
);
1508 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1510 if (timediff
> audit_timeout
) {
1511 smb_time_audit_log("sys_acl_get_entry", timediff
);
1517 static int smb_time_audit_sys_acl_get_tag_type(vfs_handle_struct
*handle
,
1518 SMB_ACL_ENTRY_T entry_d
,
1519 SMB_ACL_TAG_T
*tag_type_p
)
1522 struct timespec ts1
,ts2
;
1525 clock_gettime_mono(&ts1
);
1526 result
= SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle
, entry_d
,
1528 clock_gettime_mono(&ts2
);
1529 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1531 if (timediff
> audit_timeout
) {
1532 smb_time_audit_log("sys_acl_get_tag_type", timediff
);
1538 static int smb_time_audit_sys_acl_get_permset(vfs_handle_struct
*handle
,
1539 SMB_ACL_ENTRY_T entry_d
,
1540 SMB_ACL_PERMSET_T
*permset_p
)
1543 struct timespec ts1
,ts2
;
1546 clock_gettime_mono(&ts1
);
1547 result
= SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle
, entry_d
,
1549 clock_gettime_mono(&ts2
);
1550 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1552 if (timediff
> audit_timeout
) {
1553 smb_time_audit_log("sys_acl_get_permset", timediff
);
1559 static void * smb_time_audit_sys_acl_get_qualifier(vfs_handle_struct
*handle
,
1560 SMB_ACL_ENTRY_T entry_d
)
1563 struct timespec ts1
,ts2
;
1566 clock_gettime_mono(&ts1
);
1567 result
= SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle
, entry_d
);
1568 clock_gettime_mono(&ts2
);
1569 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1571 if (timediff
> audit_timeout
) {
1572 smb_time_audit_log("sys_acl_get_qualifier", timediff
);
1578 static SMB_ACL_T
smb_time_audit_sys_acl_get_file(vfs_handle_struct
*handle
,
1580 SMB_ACL_TYPE_T type
)
1583 struct timespec ts1
,ts2
;
1586 clock_gettime_mono(&ts1
);
1587 result
= SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle
, path_p
, type
);
1588 clock_gettime_mono(&ts2
);
1589 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1591 if (timediff
> audit_timeout
) {
1592 smb_time_audit_log("sys_acl_get_file", timediff
);
1598 static SMB_ACL_T
smb_time_audit_sys_acl_get_fd(vfs_handle_struct
*handle
,
1602 struct timespec ts1
,ts2
;
1605 clock_gettime_mono(&ts1
);
1606 result
= SMB_VFS_NEXT_SYS_ACL_GET_FD(handle
, fsp
);
1607 clock_gettime_mono(&ts2
);
1608 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1610 if (timediff
> audit_timeout
) {
1611 smb_time_audit_log("sys_acl_get_fd", timediff
);
1617 static int smb_time_audit_sys_acl_clear_perms(vfs_handle_struct
*handle
,
1618 SMB_ACL_PERMSET_T permset
)
1621 struct timespec ts1
,ts2
;
1624 clock_gettime_mono(&ts1
);
1625 result
= SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle
, permset
);
1626 clock_gettime_mono(&ts2
);
1627 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1629 if (timediff
> audit_timeout
) {
1630 smb_time_audit_log("sys_acl_clear_perms", timediff
);
1636 static int smb_time_audit_sys_acl_add_perm(vfs_handle_struct
*handle
,
1637 SMB_ACL_PERMSET_T permset
,
1638 SMB_ACL_PERM_T perm
)
1641 struct timespec ts1
,ts2
;
1644 clock_gettime_mono(&ts1
);
1645 result
= SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle
, permset
, perm
);
1646 clock_gettime_mono(&ts2
);
1647 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1649 if (timediff
> audit_timeout
) {
1650 smb_time_audit_log("sys_acl_add_perm", timediff
);
1656 static char * smb_time_audit_sys_acl_to_text(vfs_handle_struct
*handle
,
1661 struct timespec ts1
,ts2
;
1664 clock_gettime_mono(&ts1
);
1665 result
= SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle
, theacl
, plen
);
1666 clock_gettime_mono(&ts2
);
1667 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1669 if (timediff
> audit_timeout
) {
1670 smb_time_audit_log("sys_acl_to_text", timediff
);
1676 static SMB_ACL_T
smb_time_audit_sys_acl_init(vfs_handle_struct
*handle
,
1680 struct timespec ts1
,ts2
;
1683 clock_gettime_mono(&ts1
);
1684 result
= SMB_VFS_NEXT_SYS_ACL_INIT(handle
, count
);
1685 clock_gettime_mono(&ts2
);
1686 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1688 if (timediff
> audit_timeout
) {
1689 smb_time_audit_log("sys_acl_init", timediff
);
1695 static int smb_time_audit_sys_acl_create_entry(vfs_handle_struct
*handle
,
1697 SMB_ACL_ENTRY_T
*pentry
)
1700 struct timespec ts1
,ts2
;
1703 clock_gettime_mono(&ts1
);
1704 result
= SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle
, pacl
, pentry
);
1705 clock_gettime_mono(&ts2
);
1706 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1708 if (timediff
> audit_timeout
) {
1709 smb_time_audit_log("sys_acl_create_entry", timediff
);
1715 static int smb_time_audit_sys_acl_set_tag_type(vfs_handle_struct
*handle
,
1716 SMB_ACL_ENTRY_T entry
,
1717 SMB_ACL_TAG_T tagtype
)
1720 struct timespec ts1
,ts2
;
1723 clock_gettime_mono(&ts1
);
1724 result
= SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle
, entry
,
1726 clock_gettime_mono(&ts2
);
1727 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1729 if (timediff
> audit_timeout
) {
1730 smb_time_audit_log("sys_acl_set_tag_type", timediff
);
1736 static int smb_time_audit_sys_acl_set_qualifier(vfs_handle_struct
*handle
,
1737 SMB_ACL_ENTRY_T entry
,
1741 struct timespec ts1
,ts2
;
1744 clock_gettime_mono(&ts1
);
1745 result
= SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle
, entry
, qual
);
1746 clock_gettime_mono(&ts2
);
1747 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1749 if (timediff
> audit_timeout
) {
1750 smb_time_audit_log("sys_acl_set_qualifier", timediff
);
1756 static int smb_time_audit_sys_acl_set_permset(vfs_handle_struct
*handle
,
1757 SMB_ACL_ENTRY_T entry
,
1758 SMB_ACL_PERMSET_T permset
)
1761 struct timespec ts1
,ts2
;
1764 clock_gettime_mono(&ts1
);
1765 result
= SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle
, entry
, permset
);
1766 clock_gettime_mono(&ts2
);
1767 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1769 if (timediff
> audit_timeout
) {
1770 smb_time_audit_log("sys_acl_set_permset", timediff
);
1776 static int smb_time_audit_sys_acl_valid(vfs_handle_struct
*handle
,
1780 struct timespec ts1
,ts2
;
1783 clock_gettime_mono(&ts1
);
1784 result
= SMB_VFS_NEXT_SYS_ACL_VALID(handle
, theacl
);
1785 clock_gettime_mono(&ts2
);
1786 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1788 if (timediff
> audit_timeout
) {
1789 smb_time_audit_log("sys_acl_valid", timediff
);
1795 static int smb_time_audit_sys_acl_set_file(vfs_handle_struct
*handle
,
1797 SMB_ACL_TYPE_T acltype
,
1801 struct timespec ts1
,ts2
;
1804 clock_gettime_mono(&ts1
);
1805 result
= SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle
, name
, acltype
,
1807 clock_gettime_mono(&ts2
);
1808 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1810 if (timediff
> audit_timeout
) {
1811 smb_time_audit_log("sys_acl_set_file", timediff
);
1817 static int smb_time_audit_sys_acl_set_fd(vfs_handle_struct
*handle
,
1822 struct timespec ts1
,ts2
;
1825 clock_gettime_mono(&ts1
);
1826 result
= SMB_VFS_NEXT_SYS_ACL_SET_FD(handle
, fsp
, theacl
);
1827 clock_gettime_mono(&ts2
);
1828 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1830 if (timediff
> audit_timeout
) {
1831 smb_time_audit_log("sys_acl_set_fd", timediff
);
1837 static int smb_time_audit_sys_acl_delete_def_file(vfs_handle_struct
*handle
,
1841 struct timespec ts1
,ts2
;
1844 clock_gettime_mono(&ts1
);
1845 result
= SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle
, path
);
1846 clock_gettime_mono(&ts2
);
1847 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1849 if (timediff
> audit_timeout
) {
1850 smb_time_audit_log("sys_acl_delete_def_file", timediff
);
1856 static int smb_time_audit_sys_acl_get_perm(vfs_handle_struct
*handle
,
1857 SMB_ACL_PERMSET_T permset
,
1858 SMB_ACL_PERM_T perm
)
1861 struct timespec ts1
,ts2
;
1864 clock_gettime_mono(&ts1
);
1865 result
= SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle
, permset
, perm
);
1866 clock_gettime_mono(&ts2
);
1867 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1869 if (timediff
> audit_timeout
) {
1870 smb_time_audit_log("sys_acl_get_perm", timediff
);
1876 static int smb_time_audit_sys_acl_free_text(vfs_handle_struct
*handle
,
1880 struct timespec ts1
,ts2
;
1883 clock_gettime_mono(&ts1
);
1884 result
= SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle
, text
);
1885 clock_gettime_mono(&ts2
);
1886 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1888 if (timediff
> audit_timeout
) {
1889 smb_time_audit_log("sys_acl_free_text", timediff
);
1895 static int smb_time_audit_sys_acl_free_acl(vfs_handle_struct
*handle
,
1896 SMB_ACL_T posix_acl
)
1899 struct timespec ts1
,ts2
;
1902 clock_gettime_mono(&ts1
);
1903 result
= SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle
, posix_acl
);
1904 clock_gettime_mono(&ts2
);
1905 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1907 if (timediff
> audit_timeout
) {
1908 smb_time_audit_log("sys_acl_free_acl", timediff
);
1914 static int smb_time_audit_sys_acl_free_qualifier(vfs_handle_struct
*handle
,
1916 SMB_ACL_TAG_T tagtype
)
1919 struct timespec ts1
,ts2
;
1922 clock_gettime_mono(&ts1
);
1923 result
= SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle
, qualifier
,
1925 clock_gettime_mono(&ts2
);
1926 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1928 if (timediff
> audit_timeout
) {
1929 smb_time_audit_log("sys_acl_free_qualifier", timediff
);
1935 static ssize_t
smb_time_audit_getxattr(struct vfs_handle_struct
*handle
,
1936 const char *path
, const char *name
,
1937 void *value
, size_t size
)
1940 struct timespec ts1
,ts2
;
1943 clock_gettime_mono(&ts1
);
1944 result
= SMB_VFS_NEXT_GETXATTR(handle
, path
, name
, value
, size
);
1945 clock_gettime_mono(&ts2
);
1946 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1948 if (timediff
> audit_timeout
) {
1949 smb_time_audit_log("getxattr", timediff
);
1955 static ssize_t
smb_time_audit_fgetxattr(struct vfs_handle_struct
*handle
,
1956 struct files_struct
*fsp
,
1957 const char *name
, void *value
,
1961 struct timespec ts1
,ts2
;
1964 clock_gettime_mono(&ts1
);
1965 result
= SMB_VFS_NEXT_FGETXATTR(handle
, fsp
, name
, value
, size
);
1966 clock_gettime_mono(&ts2
);
1967 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1969 if (timediff
> audit_timeout
) {
1970 smb_time_audit_log("fgetxattr", timediff
);
1976 static ssize_t
smb_time_audit_listxattr(struct vfs_handle_struct
*handle
,
1977 const char *path
, char *list
,
1981 struct timespec ts1
,ts2
;
1984 clock_gettime_mono(&ts1
);
1985 result
= SMB_VFS_NEXT_LISTXATTR(handle
, path
, list
, size
);
1986 clock_gettime_mono(&ts2
);
1987 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1989 if (timediff
> audit_timeout
) {
1990 smb_time_audit_log("listxattr", timediff
);
1996 static ssize_t
smb_time_audit_flistxattr(struct vfs_handle_struct
*handle
,
1997 struct files_struct
*fsp
, char *list
,
2001 struct timespec ts1
,ts2
;
2004 clock_gettime_mono(&ts1
);
2005 result
= SMB_VFS_NEXT_FLISTXATTR(handle
, fsp
, list
, size
);
2006 clock_gettime_mono(&ts2
);
2007 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2009 if (timediff
> audit_timeout
) {
2010 smb_time_audit_log("flistxattr", timediff
);
2016 static int smb_time_audit_removexattr(struct vfs_handle_struct
*handle
,
2017 const char *path
, const char *name
)
2020 struct timespec ts1
,ts2
;
2023 clock_gettime_mono(&ts1
);
2024 result
= SMB_VFS_NEXT_REMOVEXATTR(handle
, path
, name
);
2025 clock_gettime_mono(&ts2
);
2026 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2028 if (timediff
> audit_timeout
) {
2029 smb_time_audit_log("removexattr", timediff
);
2035 static int smb_time_audit_fremovexattr(struct vfs_handle_struct
*handle
,
2036 struct files_struct
*fsp
,
2040 struct timespec ts1
,ts2
;
2043 clock_gettime_mono(&ts1
);
2044 result
= SMB_VFS_NEXT_FREMOVEXATTR(handle
, fsp
, name
);
2045 clock_gettime_mono(&ts2
);
2046 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2048 if (timediff
> audit_timeout
) {
2049 smb_time_audit_log("fremovexattr", timediff
);
2055 static int smb_time_audit_setxattr(struct vfs_handle_struct
*handle
,
2056 const char *path
, const char *name
,
2057 const void *value
, size_t size
,
2061 struct timespec ts1
,ts2
;
2064 clock_gettime_mono(&ts1
);
2065 result
= SMB_VFS_NEXT_SETXATTR(handle
, path
, name
, value
, size
,
2067 clock_gettime_mono(&ts2
);
2068 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2070 if (timediff
> audit_timeout
) {
2071 smb_time_audit_log("setxattr", timediff
);
2077 static int smb_time_audit_fsetxattr(struct vfs_handle_struct
*handle
,
2078 struct files_struct
*fsp
, const char *name
,
2079 const void *value
, size_t size
, int flags
)
2082 struct timespec ts1
,ts2
;
2085 clock_gettime_mono(&ts1
);
2086 result
= SMB_VFS_NEXT_FSETXATTR(handle
, fsp
, name
, value
, size
, flags
);
2087 clock_gettime_mono(&ts2
);
2088 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2090 if (timediff
> audit_timeout
) {
2091 smb_time_audit_log("fsetxattr", timediff
);
2097 static int smb_time_audit_aio_read(struct vfs_handle_struct
*handle
,
2098 struct files_struct
*fsp
,
2099 SMB_STRUCT_AIOCB
*aiocb
)
2102 struct timespec ts1
,ts2
;
2105 clock_gettime_mono(&ts1
);
2106 result
= SMB_VFS_NEXT_AIO_READ(handle
, fsp
, aiocb
);
2107 clock_gettime_mono(&ts2
);
2108 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2110 if (timediff
> audit_timeout
) {
2111 smb_time_audit_log("aio_read", timediff
);
2117 static int smb_time_audit_aio_write(struct vfs_handle_struct
*handle
,
2118 struct files_struct
*fsp
,
2119 SMB_STRUCT_AIOCB
*aiocb
)
2122 struct timespec ts1
,ts2
;
2125 clock_gettime_mono(&ts1
);
2126 result
= SMB_VFS_NEXT_AIO_WRITE(handle
, fsp
, aiocb
);
2127 clock_gettime_mono(&ts2
);
2128 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2130 if (timediff
> audit_timeout
) {
2131 smb_time_audit_log("aio_write", timediff
);
2137 static ssize_t
smb_time_audit_aio_return(struct vfs_handle_struct
*handle
,
2138 struct files_struct
*fsp
,
2139 SMB_STRUCT_AIOCB
*aiocb
)
2142 struct timespec ts1
,ts2
;
2145 clock_gettime_mono(&ts1
);
2146 result
= SMB_VFS_NEXT_AIO_RETURN(handle
, fsp
, aiocb
);
2147 clock_gettime_mono(&ts2
);
2148 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2150 if (timediff
> audit_timeout
) {
2151 smb_time_audit_log("aio_return", timediff
);
2157 static int smb_time_audit_aio_cancel(struct vfs_handle_struct
*handle
,
2158 struct files_struct
*fsp
,
2159 SMB_STRUCT_AIOCB
*aiocb
)
2162 struct timespec ts1
,ts2
;
2165 clock_gettime_mono(&ts1
);
2166 result
= SMB_VFS_NEXT_AIO_CANCEL(handle
, fsp
, aiocb
);
2167 clock_gettime_mono(&ts2
);
2168 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2170 if (timediff
> audit_timeout
) {
2171 smb_time_audit_log("aio_cancel", timediff
);
2177 static int smb_time_audit_aio_error(struct vfs_handle_struct
*handle
,
2178 struct files_struct
*fsp
,
2179 SMB_STRUCT_AIOCB
*aiocb
)
2182 struct timespec ts1
,ts2
;
2185 clock_gettime_mono(&ts1
);
2186 result
= SMB_VFS_NEXT_AIO_ERROR(handle
, fsp
, aiocb
);
2187 clock_gettime_mono(&ts2
);
2188 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2190 if (timediff
> audit_timeout
) {
2191 smb_time_audit_log("aio_error", timediff
);
2197 static int smb_time_audit_aio_fsync(struct vfs_handle_struct
*handle
,
2198 struct files_struct
*fsp
, int op
,
2199 SMB_STRUCT_AIOCB
*aiocb
)
2202 struct timespec ts1
,ts2
;
2205 clock_gettime_mono(&ts1
);
2206 result
= SMB_VFS_NEXT_AIO_FSYNC(handle
, fsp
, op
, aiocb
);
2207 clock_gettime_mono(&ts2
);
2208 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2210 if (timediff
> audit_timeout
) {
2211 smb_time_audit_log("aio_fsync", timediff
);
2217 static int smb_time_audit_aio_suspend(struct vfs_handle_struct
*handle
,
2218 struct files_struct
*fsp
,
2219 const SMB_STRUCT_AIOCB
* const aiocb
[],
2220 int n
, const struct timespec
*ts
)
2223 struct timespec ts1
,ts2
;
2226 clock_gettime_mono(&ts1
);
2227 result
= SMB_VFS_NEXT_AIO_SUSPEND(handle
, fsp
, aiocb
, n
, ts
);
2228 clock_gettime_mono(&ts2
);
2229 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2231 if (timediff
> audit_timeout
) {
2232 smb_time_audit_log("aio_suspend", timediff
);
2238 static bool smb_time_audit_aio_force(struct vfs_handle_struct
*handle
,
2239 struct files_struct
*fsp
)
2242 struct timespec ts1
,ts2
;
2245 clock_gettime_mono(&ts1
);
2246 result
= SMB_VFS_NEXT_AIO_FORCE(handle
, fsp
);
2247 clock_gettime_mono(&ts2
);
2248 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2250 if (timediff
> audit_timeout
) {
2251 smb_time_audit_log("aio_force", timediff
);
2259 /* VFS operations */
2261 static struct vfs_fn_pointers vfs_time_audit_fns
= {
2262 .connect_fn
= smb_time_audit_connect
,
2263 .disconnect_fn
= smb_time_audit_disconnect
,
2264 .disk_free_fn
= smb_time_audit_disk_free
,
2265 .get_quota_fn
= smb_time_audit_get_quota
,
2266 .set_quota_fn
= smb_time_audit_set_quota
,
2267 .get_shadow_copy_data_fn
= smb_time_audit_get_shadow_copy_data
,
2268 .statvfs_fn
= smb_time_audit_statvfs
,
2269 .fs_capabilities_fn
= smb_time_audit_fs_capabilities
,
2270 .opendir_fn
= smb_time_audit_opendir
,
2271 .fdopendir_fn
= smb_time_audit_fdopendir
,
2272 .readdir_fn
= smb_time_audit_readdir
,
2273 .seekdir_fn
= smb_time_audit_seekdir
,
2274 .telldir_fn
= smb_time_audit_telldir
,
2275 .rewind_dir_fn
= smb_time_audit_rewinddir
,
2276 .mkdir_fn
= smb_time_audit_mkdir
,
2277 .rmdir_fn
= smb_time_audit_rmdir
,
2278 .closedir_fn
= smb_time_audit_closedir
,
2279 .init_search_op_fn
= smb_time_audit_init_search_op
,
2280 .open_fn
= smb_time_audit_open
,
2281 .create_file_fn
= smb_time_audit_create_file
,
2282 .close_fn
= smb_time_audit_close
,
2283 .read_fn
= smb_time_audit_read
,
2284 .pread_fn
= smb_time_audit_pread
,
2285 .write_fn
= smb_time_audit_write
,
2286 .pwrite_fn
= smb_time_audit_pwrite
,
2287 .lseek_fn
= smb_time_audit_lseek
,
2288 .sendfile_fn
= smb_time_audit_sendfile
,
2289 .recvfile_fn
= smb_time_audit_recvfile
,
2290 .rename_fn
= smb_time_audit_rename
,
2291 .fsync_fn
= smb_time_audit_fsync
,
2292 .stat_fn
= smb_time_audit_stat
,
2293 .fstat_fn
= smb_time_audit_fstat
,
2294 .lstat_fn
= smb_time_audit_lstat
,
2295 .get_alloc_size_fn
= smb_time_audit_get_alloc_size
,
2296 .unlink_fn
= smb_time_audit_unlink
,
2297 .chmod_fn
= smb_time_audit_chmod
,
2298 .fchmod_fn
= smb_time_audit_fchmod
,
2299 .chown_fn
= smb_time_audit_chown
,
2300 .fchown_fn
= smb_time_audit_fchown
,
2301 .lchown_fn
= smb_time_audit_lchown
,
2302 .chdir_fn
= smb_time_audit_chdir
,
2303 .getwd_fn
= smb_time_audit_getwd
,
2304 .ntimes_fn
= smb_time_audit_ntimes
,
2305 .ftruncate_fn
= smb_time_audit_ftruncate
,
2306 .fallocate_fn
= smb_time_audit_fallocate
,
2307 .lock_fn
= smb_time_audit_lock
,
2308 .kernel_flock_fn
= smb_time_audit_kernel_flock
,
2309 .linux_setlease_fn
= smb_time_audit_linux_setlease
,
2310 .getlock_fn
= smb_time_audit_getlock
,
2311 .symlink_fn
= smb_time_audit_symlink
,
2312 .readlink_fn
= smb_time_audit_readlink
,
2313 .link_fn
= smb_time_audit_link
,
2314 .mknod_fn
= smb_time_audit_mknod
,
2315 .realpath_fn
= smb_time_audit_realpath
,
2316 .notify_watch_fn
= smb_time_audit_notify_watch
,
2317 .chflags_fn
= smb_time_audit_chflags
,
2318 .file_id_create_fn
= smb_time_audit_file_id_create
,
2319 .streaminfo_fn
= smb_time_audit_streaminfo
,
2320 .get_real_filename_fn
= smb_time_audit_get_real_filename
,
2321 .connectpath_fn
= smb_time_audit_connectpath
,
2322 .brl_lock_windows_fn
= smb_time_audit_brl_lock_windows
,
2323 .brl_unlock_windows_fn
= smb_time_audit_brl_unlock_windows
,
2324 .brl_cancel_windows_fn
= smb_time_audit_brl_cancel_windows
,
2325 .strict_lock_fn
= smb_time_audit_strict_lock
,
2326 .strict_unlock_fn
= smb_time_audit_strict_unlock
,
2327 .translate_name_fn
= smb_time_audit_translate_name
,
2328 .fget_nt_acl_fn
= smb_time_audit_fget_nt_acl
,
2329 .get_nt_acl_fn
= smb_time_audit_get_nt_acl
,
2330 .fset_nt_acl_fn
= smb_time_audit_fset_nt_acl
,
2331 .chmod_acl_fn
= smb_time_audit_chmod_acl
,
2332 .fchmod_acl_fn
= smb_time_audit_fchmod_acl
,
2333 .sys_acl_get_entry_fn
= smb_time_audit_sys_acl_get_entry
,
2334 .sys_acl_get_tag_type_fn
= smb_time_audit_sys_acl_get_tag_type
,
2335 .sys_acl_get_permset_fn
= smb_time_audit_sys_acl_get_permset
,
2336 .sys_acl_get_qualifier_fn
= smb_time_audit_sys_acl_get_qualifier
,
2337 .sys_acl_get_file_fn
= smb_time_audit_sys_acl_get_file
,
2338 .sys_acl_get_fd_fn
= smb_time_audit_sys_acl_get_fd
,
2339 .sys_acl_clear_perms_fn
= smb_time_audit_sys_acl_clear_perms
,
2340 .sys_acl_add_perm_fn
= smb_time_audit_sys_acl_add_perm
,
2341 .sys_acl_to_text_fn
= smb_time_audit_sys_acl_to_text
,
2342 .sys_acl_init_fn
= smb_time_audit_sys_acl_init
,
2343 .sys_acl_create_entry_fn
= smb_time_audit_sys_acl_create_entry
,
2344 .sys_acl_set_tag_type_fn
= smb_time_audit_sys_acl_set_tag_type
,
2345 .sys_acl_set_qualifier_fn
= smb_time_audit_sys_acl_set_qualifier
,
2346 .sys_acl_set_permset_fn
= smb_time_audit_sys_acl_set_permset
,
2347 .sys_acl_valid_fn
= smb_time_audit_sys_acl_valid
,
2348 .sys_acl_set_file_fn
= smb_time_audit_sys_acl_set_file
,
2349 .sys_acl_set_fd_fn
= smb_time_audit_sys_acl_set_fd
,
2350 .sys_acl_delete_def_file_fn
= smb_time_audit_sys_acl_delete_def_file
,
2351 .sys_acl_get_perm_fn
= smb_time_audit_sys_acl_get_perm
,
2352 .sys_acl_free_text_fn
= smb_time_audit_sys_acl_free_text
,
2353 .sys_acl_free_acl_fn
= smb_time_audit_sys_acl_free_acl
,
2354 .sys_acl_free_qualifier_fn
= smb_time_audit_sys_acl_free_qualifier
,
2355 .getxattr_fn
= smb_time_audit_getxattr
,
2356 .fgetxattr_fn
= smb_time_audit_fgetxattr
,
2357 .listxattr_fn
= smb_time_audit_listxattr
,
2358 .flistxattr_fn
= smb_time_audit_flistxattr
,
2359 .removexattr_fn
= smb_time_audit_removexattr
,
2360 .fremovexattr_fn
= smb_time_audit_fremovexattr
,
2361 .setxattr_fn
= smb_time_audit_setxattr
,
2362 .fsetxattr_fn
= smb_time_audit_fsetxattr
,
2363 .aio_read_fn
= smb_time_audit_aio_read
,
2364 .aio_write_fn
= smb_time_audit_aio_write
,
2365 .aio_return_fn
= smb_time_audit_aio_return
,
2366 .aio_cancel_fn
= smb_time_audit_aio_cancel
,
2367 .aio_error_fn
= smb_time_audit_aio_error
,
2368 .aio_fsync_fn
= smb_time_audit_aio_fsync
,
2369 .aio_suspend_fn
= smb_time_audit_aio_suspend
,
2370 .aio_force_fn
= smb_time_audit_aio_force
,
2374 NTSTATUS
vfs_time_audit_init(void);
2375 NTSTATUS
vfs_time_audit_init(void)
2377 audit_timeout
= (double)lp_parm_int(-1, "time_audit", "timeout",
2379 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION
, "time_audit",
2380 &vfs_time_audit_fns
);