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 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 SMB_STRUCT_DIR
*smb_time_audit_opendir(vfs_handle_struct
*handle
,
208 const char *mask
, uint32 attr
)
210 SMB_STRUCT_DIR
*result
;
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 SMB_STRUCT_DIR
*smb_time_audit_fdopendir(vfs_handle_struct
*handle
,
228 const char *mask
, uint32 attr
)
230 SMB_STRUCT_DIR
*result
;
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 SMB_STRUCT_DIRENT
*smb_time_audit_readdir(vfs_handle_struct
*handle
,
247 SMB_STRUCT_DIR
*dirp
,
248 SMB_STRUCT_STAT
*sbuf
)
250 SMB_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 SMB_STRUCT_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
,
285 SMB_STRUCT_DIR
*dirp
)
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
,
304 SMB_STRUCT_DIR
*dirp
)
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
,
360 SMB_STRUCT_DIR
*dirp
)
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
,
379 SMB_STRUCT_DIR
*dirp
)
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
, SMB_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 SMB_OFF_T
smb_time_audit_lseek(vfs_handle_struct
*handle
,
565 SMB_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
, SMB_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
, char *path
)
875 struct timespec ts1
,ts2
;
878 clock_gettime_mono(&ts1
);
879 result
= SMB_VFS_NEXT_GETWD(handle
, path
);
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
, SMB_OFF_T offset
, SMB_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 SMB_OFF_T
*poffset
, SMB_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
,
1133 struct notify_entry
*e
,
1134 void (*callback
)(struct sys_notify_context
*ctx
,
1136 struct notify_event
*ev
),
1137 void *private_data
, void *handle_p
)
1140 struct timespec ts1
,ts2
;
1143 clock_gettime_mono(&ts1
);
1144 result
= SMB_VFS_NEXT_NOTIFY_WATCH(handle
, ctx
, e
, callback
,
1145 private_data
, handle_p
);
1146 clock_gettime_mono(&ts2
);
1147 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1149 if (timediff
> audit_timeout
) {
1150 smb_time_audit_log("notify_watch", timediff
);
1156 static int smb_time_audit_chflags(vfs_handle_struct
*handle
,
1157 const char *path
, unsigned int flags
)
1160 struct timespec ts1
,ts2
;
1163 clock_gettime_mono(&ts1
);
1164 result
= SMB_VFS_NEXT_CHFLAGS(handle
, path
, flags
);
1165 clock_gettime_mono(&ts2
);
1166 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1168 if (timediff
> audit_timeout
) {
1169 smb_time_audit_log("chflags", timediff
);
1175 static struct file_id
smb_time_audit_file_id_create(struct vfs_handle_struct
*handle
,
1176 const SMB_STRUCT_STAT
*sbuf
)
1178 struct file_id id_zero
;
1179 struct file_id result
;
1180 struct timespec ts1
,ts2
;
1183 ZERO_STRUCT(id_zero
);
1185 clock_gettime_mono(&ts1
);
1186 result
= SMB_VFS_NEXT_FILE_ID_CREATE(handle
, sbuf
);
1187 clock_gettime_mono(&ts2
);
1188 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1190 if (timediff
> audit_timeout
) {
1191 smb_time_audit_log("file_id_create", timediff
);
1197 static NTSTATUS
smb_time_audit_streaminfo(vfs_handle_struct
*handle
,
1198 struct files_struct
*fsp
,
1200 TALLOC_CTX
*mem_ctx
,
1201 unsigned int *pnum_streams
,
1202 struct stream_struct
**pstreams
)
1205 struct timespec ts1
,ts2
;
1208 clock_gettime_mono(&ts1
);
1209 result
= SMB_VFS_NEXT_STREAMINFO(handle
, fsp
, fname
, mem_ctx
,
1210 pnum_streams
, pstreams
);
1211 clock_gettime_mono(&ts2
);
1212 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1214 if (timediff
> audit_timeout
) {
1215 smb_time_audit_log("streaminfo", timediff
);
1221 static int smb_time_audit_get_real_filename(struct vfs_handle_struct
*handle
,
1224 TALLOC_CTX
*mem_ctx
,
1228 struct timespec ts1
,ts2
;
1231 clock_gettime_mono(&ts1
);
1232 result
= SMB_VFS_NEXT_GET_REAL_FILENAME(handle
, path
, name
, mem_ctx
,
1234 clock_gettime_mono(&ts2
);
1235 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1237 if (timediff
> audit_timeout
) {
1238 smb_time_audit_log("get_real_filename", timediff
);
1244 static const char *smb_time_audit_connectpath(vfs_handle_struct
*handle
,
1248 struct timespec ts1
,ts2
;
1251 clock_gettime_mono(&ts1
);
1252 result
= SMB_VFS_NEXT_CONNECTPATH(handle
, fname
);
1253 clock_gettime_mono(&ts2
);
1254 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1256 if (timediff
> audit_timeout
) {
1257 smb_time_audit_log("connectpath", timediff
);
1263 static NTSTATUS
smb_time_audit_brl_lock_windows(struct vfs_handle_struct
*handle
,
1264 struct byte_range_lock
*br_lck
,
1265 struct lock_struct
*plock
,
1267 struct blocking_lock_record
*blr
)
1270 struct timespec ts1
,ts2
;
1273 clock_gettime_mono(&ts1
);
1274 result
= SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle
, br_lck
, plock
,
1275 blocking_lock
, blr
);
1276 clock_gettime_mono(&ts2
);
1277 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1279 if (timediff
> audit_timeout
) {
1280 smb_time_audit_log("brl_lock_windows", timediff
);
1286 static bool smb_time_audit_brl_unlock_windows(struct vfs_handle_struct
*handle
,
1287 struct messaging_context
*msg_ctx
,
1288 struct byte_range_lock
*br_lck
,
1289 const struct lock_struct
*plock
)
1292 struct timespec ts1
,ts2
;
1295 clock_gettime_mono(&ts1
);
1296 result
= SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle
, msg_ctx
, br_lck
,
1298 clock_gettime_mono(&ts2
);
1299 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1301 if (timediff
> audit_timeout
) {
1302 smb_time_audit_log("brl_unlock_windows", timediff
);
1308 static bool smb_time_audit_brl_cancel_windows(struct vfs_handle_struct
*handle
,
1309 struct byte_range_lock
*br_lck
,
1310 struct lock_struct
*plock
,
1311 struct blocking_lock_record
*blr
)
1314 struct timespec ts1
,ts2
;
1317 clock_gettime_mono(&ts1
);
1318 result
= SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle
, br_lck
, plock
, blr
);
1319 clock_gettime_mono(&ts2
);
1320 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1322 if (timediff
> audit_timeout
) {
1323 smb_time_audit_log("brl_cancel_windows", timediff
);
1329 static bool smb_time_audit_strict_lock(struct vfs_handle_struct
*handle
,
1330 struct files_struct
*fsp
,
1331 struct lock_struct
*plock
)
1334 struct timespec ts1
,ts2
;
1337 clock_gettime_mono(&ts1
);
1338 result
= SMB_VFS_NEXT_STRICT_LOCK(handle
, fsp
, plock
);
1339 clock_gettime_mono(&ts2
);
1340 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1342 if (timediff
> audit_timeout
) {
1343 smb_time_audit_log("strict_lock", timediff
);
1349 static void smb_time_audit_strict_unlock(struct vfs_handle_struct
*handle
,
1350 struct files_struct
*fsp
,
1351 struct lock_struct
*plock
)
1353 struct timespec ts1
,ts2
;
1356 clock_gettime_mono(&ts1
);
1357 SMB_VFS_NEXT_STRICT_UNLOCK(handle
, fsp
, plock
);
1358 clock_gettime_mono(&ts2
);
1359 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1361 if (timediff
> audit_timeout
) {
1362 smb_time_audit_log("strict_unlock", timediff
);
1368 static NTSTATUS
smb_time_audit_translate_name(struct vfs_handle_struct
*handle
,
1370 enum vfs_translate_direction direction
,
1371 TALLOC_CTX
*mem_ctx
,
1375 struct timespec ts1
,ts2
;
1378 clock_gettime_mono(&ts1
);
1379 result
= SMB_VFS_NEXT_TRANSLATE_NAME(handle
, name
, direction
, mem_ctx
,
1381 clock_gettime_mono(&ts2
);
1382 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1384 if (timediff
> audit_timeout
) {
1385 smb_time_audit_log("translate_name", timediff
);
1391 static NTSTATUS
smb_time_audit_fget_nt_acl(vfs_handle_struct
*handle
,
1393 uint32 security_info
,
1394 struct security_descriptor
**ppdesc
)
1397 struct timespec ts1
,ts2
;
1400 clock_gettime_mono(&ts1
);
1401 result
= SMB_VFS_NEXT_FGET_NT_ACL(handle
, fsp
, security_info
, ppdesc
);
1402 clock_gettime_mono(&ts2
);
1403 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1405 if (timediff
> audit_timeout
) {
1406 smb_time_audit_log("fget_nt_acl", timediff
);
1412 static NTSTATUS
smb_time_audit_get_nt_acl(vfs_handle_struct
*handle
,
1414 uint32 security_info
,
1415 struct security_descriptor
**ppdesc
)
1418 struct timespec ts1
,ts2
;
1421 clock_gettime_mono(&ts1
);
1422 result
= SMB_VFS_NEXT_GET_NT_ACL(handle
, name
, security_info
, ppdesc
);
1423 clock_gettime_mono(&ts2
);
1424 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1426 if (timediff
> audit_timeout
) {
1427 smb_time_audit_log("get_nt_acl", timediff
);
1433 static NTSTATUS
smb_time_audit_fset_nt_acl(vfs_handle_struct
*handle
,
1435 uint32 security_info_sent
,
1436 const struct security_descriptor
*psd
)
1439 struct timespec ts1
,ts2
;
1442 clock_gettime_mono(&ts1
);
1443 result
= SMB_VFS_NEXT_FSET_NT_ACL(handle
, fsp
, security_info_sent
,
1445 clock_gettime_mono(&ts2
);
1446 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1448 if (timediff
> audit_timeout
) {
1449 smb_time_audit_log("fset_nt_acl", timediff
);
1455 static int smb_time_audit_chmod_acl(vfs_handle_struct
*handle
,
1456 const char *path
, mode_t mode
)
1459 struct timespec ts1
,ts2
;
1462 clock_gettime_mono(&ts1
);
1463 result
= SMB_VFS_NEXT_CHMOD_ACL(handle
, path
, mode
);
1464 clock_gettime_mono(&ts2
);
1465 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1467 if (timediff
> audit_timeout
) {
1468 smb_time_audit_log("chmod_acl", timediff
);
1474 static int smb_time_audit_fchmod_acl(vfs_handle_struct
*handle
,
1475 files_struct
*fsp
, mode_t mode
)
1478 struct timespec ts1
,ts2
;
1481 clock_gettime_mono(&ts1
);
1482 result
= SMB_VFS_NEXT_FCHMOD_ACL(handle
, fsp
, mode
);
1483 clock_gettime_mono(&ts2
);
1484 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1486 if (timediff
> audit_timeout
) {
1487 smb_time_audit_log("fchmod_acl", timediff
);
1493 static int smb_time_audit_sys_acl_get_entry(vfs_handle_struct
*handle
,
1494 SMB_ACL_T theacl
, int entry_id
,
1495 SMB_ACL_ENTRY_T
*entry_p
)
1498 struct timespec ts1
,ts2
;
1501 clock_gettime_mono(&ts1
);
1502 result
= SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle
, theacl
, entry_id
,
1504 clock_gettime_mono(&ts2
);
1505 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1507 if (timediff
> audit_timeout
) {
1508 smb_time_audit_log("sys_acl_get_entry", timediff
);
1514 static int smb_time_audit_sys_acl_get_tag_type(vfs_handle_struct
*handle
,
1515 SMB_ACL_ENTRY_T entry_d
,
1516 SMB_ACL_TAG_T
*tag_type_p
)
1519 struct timespec ts1
,ts2
;
1522 clock_gettime_mono(&ts1
);
1523 result
= SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle
, entry_d
,
1525 clock_gettime_mono(&ts2
);
1526 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1528 if (timediff
> audit_timeout
) {
1529 smb_time_audit_log("sys_acl_get_tag_type", timediff
);
1535 static int smb_time_audit_sys_acl_get_permset(vfs_handle_struct
*handle
,
1536 SMB_ACL_ENTRY_T entry_d
,
1537 SMB_ACL_PERMSET_T
*permset_p
)
1540 struct timespec ts1
,ts2
;
1543 clock_gettime_mono(&ts1
);
1544 result
= SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle
, entry_d
,
1546 clock_gettime_mono(&ts2
);
1547 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1549 if (timediff
> audit_timeout
) {
1550 smb_time_audit_log("sys_acl_get_permset", timediff
);
1556 static void * smb_time_audit_sys_acl_get_qualifier(vfs_handle_struct
*handle
,
1557 SMB_ACL_ENTRY_T entry_d
)
1560 struct timespec ts1
,ts2
;
1563 clock_gettime_mono(&ts1
);
1564 result
= SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle
, entry_d
);
1565 clock_gettime_mono(&ts2
);
1566 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1568 if (timediff
> audit_timeout
) {
1569 smb_time_audit_log("sys_acl_get_qualifier", timediff
);
1575 static SMB_ACL_T
smb_time_audit_sys_acl_get_file(vfs_handle_struct
*handle
,
1577 SMB_ACL_TYPE_T type
)
1580 struct timespec ts1
,ts2
;
1583 clock_gettime_mono(&ts1
);
1584 result
= SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle
, path_p
, type
);
1585 clock_gettime_mono(&ts2
);
1586 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1588 if (timediff
> audit_timeout
) {
1589 smb_time_audit_log("sys_acl_get_file", timediff
);
1595 static SMB_ACL_T
smb_time_audit_sys_acl_get_fd(vfs_handle_struct
*handle
,
1599 struct timespec ts1
,ts2
;
1602 clock_gettime_mono(&ts1
);
1603 result
= SMB_VFS_NEXT_SYS_ACL_GET_FD(handle
, fsp
);
1604 clock_gettime_mono(&ts2
);
1605 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1607 if (timediff
> audit_timeout
) {
1608 smb_time_audit_log("sys_acl_get_fd", timediff
);
1614 static int smb_time_audit_sys_acl_clear_perms(vfs_handle_struct
*handle
,
1615 SMB_ACL_PERMSET_T permset
)
1618 struct timespec ts1
,ts2
;
1621 clock_gettime_mono(&ts1
);
1622 result
= SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle
, permset
);
1623 clock_gettime_mono(&ts2
);
1624 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1626 if (timediff
> audit_timeout
) {
1627 smb_time_audit_log("sys_acl_clear_perms", timediff
);
1633 static int smb_time_audit_sys_acl_add_perm(vfs_handle_struct
*handle
,
1634 SMB_ACL_PERMSET_T permset
,
1635 SMB_ACL_PERM_T perm
)
1638 struct timespec ts1
,ts2
;
1641 clock_gettime_mono(&ts1
);
1642 result
= SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle
, permset
, perm
);
1643 clock_gettime_mono(&ts2
);
1644 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1646 if (timediff
> audit_timeout
) {
1647 smb_time_audit_log("sys_acl_add_perm", timediff
);
1653 static char * smb_time_audit_sys_acl_to_text(vfs_handle_struct
*handle
,
1658 struct timespec ts1
,ts2
;
1661 clock_gettime_mono(&ts1
);
1662 result
= SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle
, theacl
, plen
);
1663 clock_gettime_mono(&ts2
);
1664 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1666 if (timediff
> audit_timeout
) {
1667 smb_time_audit_log("sys_acl_to_text", timediff
);
1673 static SMB_ACL_T
smb_time_audit_sys_acl_init(vfs_handle_struct
*handle
,
1677 struct timespec ts1
,ts2
;
1680 clock_gettime_mono(&ts1
);
1681 result
= SMB_VFS_NEXT_SYS_ACL_INIT(handle
, count
);
1682 clock_gettime_mono(&ts2
);
1683 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1685 if (timediff
> audit_timeout
) {
1686 smb_time_audit_log("sys_acl_init", timediff
);
1692 static int smb_time_audit_sys_acl_create_entry(vfs_handle_struct
*handle
,
1694 SMB_ACL_ENTRY_T
*pentry
)
1697 struct timespec ts1
,ts2
;
1700 clock_gettime_mono(&ts1
);
1701 result
= SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle
, pacl
, pentry
);
1702 clock_gettime_mono(&ts2
);
1703 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1705 if (timediff
> audit_timeout
) {
1706 smb_time_audit_log("sys_acl_create_entry", timediff
);
1712 static int smb_time_audit_sys_acl_set_tag_type(vfs_handle_struct
*handle
,
1713 SMB_ACL_ENTRY_T entry
,
1714 SMB_ACL_TAG_T tagtype
)
1717 struct timespec ts1
,ts2
;
1720 clock_gettime_mono(&ts1
);
1721 result
= SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle
, entry
,
1723 clock_gettime_mono(&ts2
);
1724 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1726 if (timediff
> audit_timeout
) {
1727 smb_time_audit_log("sys_acl_set_tag_type", timediff
);
1733 static int smb_time_audit_sys_acl_set_qualifier(vfs_handle_struct
*handle
,
1734 SMB_ACL_ENTRY_T entry
,
1738 struct timespec ts1
,ts2
;
1741 clock_gettime_mono(&ts1
);
1742 result
= SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle
, entry
, qual
);
1743 clock_gettime_mono(&ts2
);
1744 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1746 if (timediff
> audit_timeout
) {
1747 smb_time_audit_log("sys_acl_set_qualifier", timediff
);
1753 static int smb_time_audit_sys_acl_set_permset(vfs_handle_struct
*handle
,
1754 SMB_ACL_ENTRY_T entry
,
1755 SMB_ACL_PERMSET_T permset
)
1758 struct timespec ts1
,ts2
;
1761 clock_gettime_mono(&ts1
);
1762 result
= SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle
, entry
, permset
);
1763 clock_gettime_mono(&ts2
);
1764 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1766 if (timediff
> audit_timeout
) {
1767 smb_time_audit_log("sys_acl_set_permset", timediff
);
1773 static int smb_time_audit_sys_acl_valid(vfs_handle_struct
*handle
,
1777 struct timespec ts1
,ts2
;
1780 clock_gettime_mono(&ts1
);
1781 result
= SMB_VFS_NEXT_SYS_ACL_VALID(handle
, theacl
);
1782 clock_gettime_mono(&ts2
);
1783 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1785 if (timediff
> audit_timeout
) {
1786 smb_time_audit_log("sys_acl_valid", timediff
);
1792 static int smb_time_audit_sys_acl_set_file(vfs_handle_struct
*handle
,
1794 SMB_ACL_TYPE_T acltype
,
1798 struct timespec ts1
,ts2
;
1801 clock_gettime_mono(&ts1
);
1802 result
= SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle
, name
, acltype
,
1804 clock_gettime_mono(&ts2
);
1805 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1807 if (timediff
> audit_timeout
) {
1808 smb_time_audit_log("sys_acl_set_file", timediff
);
1814 static int smb_time_audit_sys_acl_set_fd(vfs_handle_struct
*handle
,
1819 struct timespec ts1
,ts2
;
1822 clock_gettime_mono(&ts1
);
1823 result
= SMB_VFS_NEXT_SYS_ACL_SET_FD(handle
, fsp
, theacl
);
1824 clock_gettime_mono(&ts2
);
1825 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1827 if (timediff
> audit_timeout
) {
1828 smb_time_audit_log("sys_acl_set_fd", timediff
);
1834 static int smb_time_audit_sys_acl_delete_def_file(vfs_handle_struct
*handle
,
1838 struct timespec ts1
,ts2
;
1841 clock_gettime_mono(&ts1
);
1842 result
= SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle
, path
);
1843 clock_gettime_mono(&ts2
);
1844 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1846 if (timediff
> audit_timeout
) {
1847 smb_time_audit_log("sys_acl_delete_def_file", timediff
);
1853 static int smb_time_audit_sys_acl_get_perm(vfs_handle_struct
*handle
,
1854 SMB_ACL_PERMSET_T permset
,
1855 SMB_ACL_PERM_T perm
)
1858 struct timespec ts1
,ts2
;
1861 clock_gettime_mono(&ts1
);
1862 result
= SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle
, permset
, perm
);
1863 clock_gettime_mono(&ts2
);
1864 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1866 if (timediff
> audit_timeout
) {
1867 smb_time_audit_log("sys_acl_get_perm", timediff
);
1873 static int smb_time_audit_sys_acl_free_text(vfs_handle_struct
*handle
,
1877 struct timespec ts1
,ts2
;
1880 clock_gettime_mono(&ts1
);
1881 result
= SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle
, text
);
1882 clock_gettime_mono(&ts2
);
1883 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1885 if (timediff
> audit_timeout
) {
1886 smb_time_audit_log("sys_acl_free_text", timediff
);
1892 static int smb_time_audit_sys_acl_free_acl(vfs_handle_struct
*handle
,
1893 SMB_ACL_T posix_acl
)
1896 struct timespec ts1
,ts2
;
1899 clock_gettime_mono(&ts1
);
1900 result
= SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle
, posix_acl
);
1901 clock_gettime_mono(&ts2
);
1902 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1904 if (timediff
> audit_timeout
) {
1905 smb_time_audit_log("sys_acl_free_acl", timediff
);
1911 static int smb_time_audit_sys_acl_free_qualifier(vfs_handle_struct
*handle
,
1913 SMB_ACL_TAG_T tagtype
)
1916 struct timespec ts1
,ts2
;
1919 clock_gettime_mono(&ts1
);
1920 result
= SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle
, qualifier
,
1922 clock_gettime_mono(&ts2
);
1923 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1925 if (timediff
> audit_timeout
) {
1926 smb_time_audit_log("sys_acl_free_qualifier", timediff
);
1932 static ssize_t
smb_time_audit_getxattr(struct vfs_handle_struct
*handle
,
1933 const char *path
, const char *name
,
1934 void *value
, size_t size
)
1937 struct timespec ts1
,ts2
;
1940 clock_gettime_mono(&ts1
);
1941 result
= SMB_VFS_NEXT_GETXATTR(handle
, path
, name
, value
, size
);
1942 clock_gettime_mono(&ts2
);
1943 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1945 if (timediff
> audit_timeout
) {
1946 smb_time_audit_log("getxattr", timediff
);
1952 static ssize_t
smb_time_audit_lgetxattr(struct vfs_handle_struct
*handle
,
1953 const char *path
, const char *name
,
1954 void *value
, size_t size
)
1957 struct timespec ts1
,ts2
;
1960 clock_gettime_mono(&ts1
);
1961 result
= SMB_VFS_NEXT_LGETXATTR(handle
, path
, name
, value
, size
);
1962 clock_gettime_mono(&ts2
);
1963 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1965 if (timediff
> audit_timeout
) {
1966 smb_time_audit_log("lgetxattr", timediff
);
1972 static ssize_t
smb_time_audit_fgetxattr(struct vfs_handle_struct
*handle
,
1973 struct files_struct
*fsp
,
1974 const char *name
, void *value
,
1978 struct timespec ts1
,ts2
;
1981 clock_gettime_mono(&ts1
);
1982 result
= SMB_VFS_NEXT_FGETXATTR(handle
, fsp
, name
, value
, size
);
1983 clock_gettime_mono(&ts2
);
1984 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1986 if (timediff
> audit_timeout
) {
1987 smb_time_audit_log("fgetxattr", timediff
);
1993 static ssize_t
smb_time_audit_listxattr(struct vfs_handle_struct
*handle
,
1994 const char *path
, char *list
,
1998 struct timespec ts1
,ts2
;
2001 clock_gettime_mono(&ts1
);
2002 result
= SMB_VFS_NEXT_LISTXATTR(handle
, path
, list
, size
);
2003 clock_gettime_mono(&ts2
);
2004 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2006 if (timediff
> audit_timeout
) {
2007 smb_time_audit_log("listxattr", timediff
);
2013 static ssize_t
smb_time_audit_llistxattr(struct vfs_handle_struct
*handle
,
2014 const char *path
, char *list
,
2018 struct timespec ts1
,ts2
;
2021 clock_gettime_mono(&ts1
);
2022 result
= SMB_VFS_NEXT_LLISTXATTR(handle
, path
, list
, size
);
2023 clock_gettime_mono(&ts2
);
2024 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2026 if (timediff
> audit_timeout
) {
2027 smb_time_audit_log("llistxattr", timediff
);
2033 static ssize_t
smb_time_audit_flistxattr(struct vfs_handle_struct
*handle
,
2034 struct files_struct
*fsp
, char *list
,
2038 struct timespec ts1
,ts2
;
2041 clock_gettime_mono(&ts1
);
2042 result
= SMB_VFS_NEXT_FLISTXATTR(handle
, fsp
, list
, size
);
2043 clock_gettime_mono(&ts2
);
2044 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2046 if (timediff
> audit_timeout
) {
2047 smb_time_audit_log("flistxattr", timediff
);
2053 static int smb_time_audit_removexattr(struct vfs_handle_struct
*handle
,
2054 const char *path
, const char *name
)
2057 struct timespec ts1
,ts2
;
2060 clock_gettime_mono(&ts1
);
2061 result
= SMB_VFS_NEXT_REMOVEXATTR(handle
, path
, name
);
2062 clock_gettime_mono(&ts2
);
2063 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2065 if (timediff
> audit_timeout
) {
2066 smb_time_audit_log("removexattr", timediff
);
2072 static int smb_time_audit_lremovexattr(struct vfs_handle_struct
*handle
,
2073 const char *path
, const char *name
)
2076 struct timespec ts1
,ts2
;
2079 clock_gettime_mono(&ts1
);
2080 result
= SMB_VFS_NEXT_LREMOVEXATTR(handle
, path
, name
);
2081 clock_gettime_mono(&ts2
);
2082 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2084 if (timediff
> audit_timeout
) {
2085 smb_time_audit_log("lremovexattr", timediff
);
2091 static int smb_time_audit_fremovexattr(struct vfs_handle_struct
*handle
,
2092 struct files_struct
*fsp
,
2096 struct timespec ts1
,ts2
;
2099 clock_gettime_mono(&ts1
);
2100 result
= SMB_VFS_NEXT_FREMOVEXATTR(handle
, fsp
, name
);
2101 clock_gettime_mono(&ts2
);
2102 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2104 if (timediff
> audit_timeout
) {
2105 smb_time_audit_log("fremovexattr", timediff
);
2111 static int smb_time_audit_setxattr(struct vfs_handle_struct
*handle
,
2112 const char *path
, const char *name
,
2113 const void *value
, size_t size
,
2117 struct timespec ts1
,ts2
;
2120 clock_gettime_mono(&ts1
);
2121 result
= SMB_VFS_NEXT_SETXATTR(handle
, path
, name
, value
, size
,
2123 clock_gettime_mono(&ts2
);
2124 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2126 if (timediff
> audit_timeout
) {
2127 smb_time_audit_log("setxattr", timediff
);
2133 static int smb_time_audit_lsetxattr(struct vfs_handle_struct
*handle
,
2134 const char *path
, const char *name
,
2135 const void *value
, size_t size
,
2139 struct timespec ts1
,ts2
;
2142 clock_gettime_mono(&ts1
);
2143 result
= SMB_VFS_NEXT_LSETXATTR(handle
, path
, name
, value
, size
,
2145 clock_gettime_mono(&ts2
);
2146 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2148 if (timediff
> audit_timeout
) {
2149 smb_time_audit_log("lsetxattr", timediff
);
2155 static int smb_time_audit_fsetxattr(struct vfs_handle_struct
*handle
,
2156 struct files_struct
*fsp
, const char *name
,
2157 const void *value
, size_t size
, int flags
)
2160 struct timespec ts1
,ts2
;
2163 clock_gettime_mono(&ts1
);
2164 result
= SMB_VFS_NEXT_FSETXATTR(handle
, fsp
, name
, value
, size
, flags
);
2165 clock_gettime_mono(&ts2
);
2166 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2168 if (timediff
> audit_timeout
) {
2169 smb_time_audit_log("fsetxattr", timediff
);
2175 static int smb_time_audit_aio_read(struct vfs_handle_struct
*handle
,
2176 struct files_struct
*fsp
,
2177 SMB_STRUCT_AIOCB
*aiocb
)
2180 struct timespec ts1
,ts2
;
2183 clock_gettime_mono(&ts1
);
2184 result
= SMB_VFS_NEXT_AIO_READ(handle
, fsp
, aiocb
);
2185 clock_gettime_mono(&ts2
);
2186 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2188 if (timediff
> audit_timeout
) {
2189 smb_time_audit_log("aio_read", timediff
);
2195 static int smb_time_audit_aio_write(struct vfs_handle_struct
*handle
,
2196 struct files_struct
*fsp
,
2197 SMB_STRUCT_AIOCB
*aiocb
)
2200 struct timespec ts1
,ts2
;
2203 clock_gettime_mono(&ts1
);
2204 result
= SMB_VFS_NEXT_AIO_WRITE(handle
, fsp
, aiocb
);
2205 clock_gettime_mono(&ts2
);
2206 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2208 if (timediff
> audit_timeout
) {
2209 smb_time_audit_log("aio_write", timediff
);
2215 static ssize_t
smb_time_audit_aio_return(struct vfs_handle_struct
*handle
,
2216 struct files_struct
*fsp
,
2217 SMB_STRUCT_AIOCB
*aiocb
)
2220 struct timespec ts1
,ts2
;
2223 clock_gettime_mono(&ts1
);
2224 result
= SMB_VFS_NEXT_AIO_RETURN(handle
, fsp
, aiocb
);
2225 clock_gettime_mono(&ts2
);
2226 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2228 if (timediff
> audit_timeout
) {
2229 smb_time_audit_log("aio_return", timediff
);
2235 static int smb_time_audit_aio_cancel(struct vfs_handle_struct
*handle
,
2236 struct files_struct
*fsp
,
2237 SMB_STRUCT_AIOCB
*aiocb
)
2240 struct timespec ts1
,ts2
;
2243 clock_gettime_mono(&ts1
);
2244 result
= SMB_VFS_NEXT_AIO_CANCEL(handle
, fsp
, aiocb
);
2245 clock_gettime_mono(&ts2
);
2246 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2248 if (timediff
> audit_timeout
) {
2249 smb_time_audit_log("aio_cancel", timediff
);
2255 static int smb_time_audit_aio_error(struct vfs_handle_struct
*handle
,
2256 struct files_struct
*fsp
,
2257 SMB_STRUCT_AIOCB
*aiocb
)
2260 struct timespec ts1
,ts2
;
2263 clock_gettime_mono(&ts1
);
2264 result
= SMB_VFS_NEXT_AIO_ERROR(handle
, fsp
, aiocb
);
2265 clock_gettime_mono(&ts2
);
2266 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2268 if (timediff
> audit_timeout
) {
2269 smb_time_audit_log("aio_error", timediff
);
2275 static int smb_time_audit_aio_fsync(struct vfs_handle_struct
*handle
,
2276 struct files_struct
*fsp
, int op
,
2277 SMB_STRUCT_AIOCB
*aiocb
)
2280 struct timespec ts1
,ts2
;
2283 clock_gettime_mono(&ts1
);
2284 result
= SMB_VFS_NEXT_AIO_FSYNC(handle
, fsp
, op
, aiocb
);
2285 clock_gettime_mono(&ts2
);
2286 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2288 if (timediff
> audit_timeout
) {
2289 smb_time_audit_log("aio_fsync", timediff
);
2295 static int smb_time_audit_aio_suspend(struct vfs_handle_struct
*handle
,
2296 struct files_struct
*fsp
,
2297 const SMB_STRUCT_AIOCB
* const aiocb
[],
2298 int n
, const struct timespec
*ts
)
2301 struct timespec ts1
,ts2
;
2304 clock_gettime_mono(&ts1
);
2305 result
= SMB_VFS_NEXT_AIO_SUSPEND(handle
, fsp
, aiocb
, n
, ts
);
2306 clock_gettime_mono(&ts2
);
2307 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2309 if (timediff
> audit_timeout
) {
2310 smb_time_audit_log("aio_suspend", timediff
);
2316 static bool smb_time_audit_aio_force(struct vfs_handle_struct
*handle
,
2317 struct files_struct
*fsp
)
2320 struct timespec ts1
,ts2
;
2323 clock_gettime_mono(&ts1
);
2324 result
= SMB_VFS_NEXT_AIO_FORCE(handle
, fsp
);
2325 clock_gettime_mono(&ts2
);
2326 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2328 if (timediff
> audit_timeout
) {
2329 smb_time_audit_log("aio_force", timediff
);
2337 /* VFS operations */
2339 static struct vfs_fn_pointers vfs_time_audit_fns
= {
2340 .connect_fn
= smb_time_audit_connect
,
2341 .disconnect
= smb_time_audit_disconnect
,
2342 .disk_free
= smb_time_audit_disk_free
,
2343 .get_quota
= smb_time_audit_get_quota
,
2344 .set_quota
= smb_time_audit_set_quota
,
2345 .get_shadow_copy_data
= smb_time_audit_get_shadow_copy_data
,
2346 .statvfs
= smb_time_audit_statvfs
,
2347 .fs_capabilities
= smb_time_audit_fs_capabilities
,
2348 .opendir
= smb_time_audit_opendir
,
2349 .fdopendir
= smb_time_audit_fdopendir
,
2350 .readdir
= smb_time_audit_readdir
,
2351 .seekdir
= smb_time_audit_seekdir
,
2352 .telldir
= smb_time_audit_telldir
,
2353 .rewind_dir
= smb_time_audit_rewinddir
,
2354 .mkdir
= smb_time_audit_mkdir
,
2355 .rmdir
= smb_time_audit_rmdir
,
2356 .closedir
= smb_time_audit_closedir
,
2357 .init_search_op
= smb_time_audit_init_search_op
,
2358 .open_fn
= smb_time_audit_open
,
2359 .create_file
= smb_time_audit_create_file
,
2360 .close_fn
= smb_time_audit_close
,
2361 .vfs_read
= smb_time_audit_read
,
2362 .pread
= smb_time_audit_pread
,
2363 .write
= smb_time_audit_write
,
2364 .pwrite
= smb_time_audit_pwrite
,
2365 .lseek
= smb_time_audit_lseek
,
2366 .sendfile
= smb_time_audit_sendfile
,
2367 .recvfile
= smb_time_audit_recvfile
,
2368 .rename
= smb_time_audit_rename
,
2369 .fsync
= smb_time_audit_fsync
,
2370 .stat
= smb_time_audit_stat
,
2371 .fstat
= smb_time_audit_fstat
,
2372 .lstat
= smb_time_audit_lstat
,
2373 .get_alloc_size
= smb_time_audit_get_alloc_size
,
2374 .unlink
= smb_time_audit_unlink
,
2375 .chmod
= smb_time_audit_chmod
,
2376 .fchmod
= smb_time_audit_fchmod
,
2377 .chown
= smb_time_audit_chown
,
2378 .fchown
= smb_time_audit_fchown
,
2379 .lchown
= smb_time_audit_lchown
,
2380 .chdir
= smb_time_audit_chdir
,
2381 .getwd
= smb_time_audit_getwd
,
2382 .ntimes
= smb_time_audit_ntimes
,
2383 .ftruncate
= smb_time_audit_ftruncate
,
2384 .fallocate
= smb_time_audit_fallocate
,
2385 .lock
= smb_time_audit_lock
,
2386 .kernel_flock
= smb_time_audit_kernel_flock
,
2387 .linux_setlease
= smb_time_audit_linux_setlease
,
2388 .getlock
= smb_time_audit_getlock
,
2389 .symlink
= smb_time_audit_symlink
,
2390 .vfs_readlink
= smb_time_audit_readlink
,
2391 .link
= smb_time_audit_link
,
2392 .mknod
= smb_time_audit_mknod
,
2393 .realpath
= smb_time_audit_realpath
,
2394 .notify_watch
= smb_time_audit_notify_watch
,
2395 .chflags
= smb_time_audit_chflags
,
2396 .file_id_create
= smb_time_audit_file_id_create
,
2397 .streaminfo
= smb_time_audit_streaminfo
,
2398 .get_real_filename
= smb_time_audit_get_real_filename
,
2399 .connectpath
= smb_time_audit_connectpath
,
2400 .brl_lock_windows
= smb_time_audit_brl_lock_windows
,
2401 .brl_unlock_windows
= smb_time_audit_brl_unlock_windows
,
2402 .brl_cancel_windows
= smb_time_audit_brl_cancel_windows
,
2403 .strict_lock
= smb_time_audit_strict_lock
,
2404 .strict_unlock
= smb_time_audit_strict_unlock
,
2405 .translate_name
= smb_time_audit_translate_name
,
2406 .fget_nt_acl
= smb_time_audit_fget_nt_acl
,
2407 .get_nt_acl
= smb_time_audit_get_nt_acl
,
2408 .fset_nt_acl
= smb_time_audit_fset_nt_acl
,
2409 .chmod_acl
= smb_time_audit_chmod_acl
,
2410 .fchmod_acl
= smb_time_audit_fchmod_acl
,
2411 .sys_acl_get_entry
= smb_time_audit_sys_acl_get_entry
,
2412 .sys_acl_get_tag_type
= smb_time_audit_sys_acl_get_tag_type
,
2413 .sys_acl_get_permset
= smb_time_audit_sys_acl_get_permset
,
2414 .sys_acl_get_qualifier
= smb_time_audit_sys_acl_get_qualifier
,
2415 .sys_acl_get_file
= smb_time_audit_sys_acl_get_file
,
2416 .sys_acl_get_fd
= smb_time_audit_sys_acl_get_fd
,
2417 .sys_acl_clear_perms
= smb_time_audit_sys_acl_clear_perms
,
2418 .sys_acl_add_perm
= smb_time_audit_sys_acl_add_perm
,
2419 .sys_acl_to_text
= smb_time_audit_sys_acl_to_text
,
2420 .sys_acl_init
= smb_time_audit_sys_acl_init
,
2421 .sys_acl_create_entry
= smb_time_audit_sys_acl_create_entry
,
2422 .sys_acl_set_tag_type
= smb_time_audit_sys_acl_set_tag_type
,
2423 .sys_acl_set_qualifier
= smb_time_audit_sys_acl_set_qualifier
,
2424 .sys_acl_set_permset
= smb_time_audit_sys_acl_set_permset
,
2425 .sys_acl_valid
= smb_time_audit_sys_acl_valid
,
2426 .sys_acl_set_file
= smb_time_audit_sys_acl_set_file
,
2427 .sys_acl_set_fd
= smb_time_audit_sys_acl_set_fd
,
2428 .sys_acl_delete_def_file
= smb_time_audit_sys_acl_delete_def_file
,
2429 .sys_acl_get_perm
= smb_time_audit_sys_acl_get_perm
,
2430 .sys_acl_free_text
= smb_time_audit_sys_acl_free_text
,
2431 .sys_acl_free_acl
= smb_time_audit_sys_acl_free_acl
,
2432 .sys_acl_free_qualifier
= smb_time_audit_sys_acl_free_qualifier
,
2433 .getxattr
= smb_time_audit_getxattr
,
2434 .lgetxattr
= smb_time_audit_lgetxattr
,
2435 .fgetxattr
= smb_time_audit_fgetxattr
,
2436 .listxattr
= smb_time_audit_listxattr
,
2437 .llistxattr
= smb_time_audit_llistxattr
,
2438 .flistxattr
= smb_time_audit_flistxattr
,
2439 .removexattr
= smb_time_audit_removexattr
,
2440 .lremovexattr
= smb_time_audit_lremovexattr
,
2441 .fremovexattr
= smb_time_audit_fremovexattr
,
2442 .setxattr
= smb_time_audit_setxattr
,
2443 .lsetxattr
= smb_time_audit_lsetxattr
,
2444 .fsetxattr
= smb_time_audit_fsetxattr
,
2445 .aio_read
= smb_time_audit_aio_read
,
2446 .aio_write
= smb_time_audit_aio_write
,
2447 .aio_return_fn
= smb_time_audit_aio_return
,
2448 .aio_cancel
= smb_time_audit_aio_cancel
,
2449 .aio_error_fn
= smb_time_audit_aio_error
,
2450 .aio_fsync
= smb_time_audit_aio_fsync
,
2451 .aio_suspend
= smb_time_audit_aio_suspend
,
2452 .aio_force
= smb_time_audit_aio_force
,
2456 NTSTATUS
vfs_time_audit_init(void);
2457 NTSTATUS
vfs_time_audit_init(void)
2459 audit_timeout
= (double)lp_parm_int(-1, "time_audit", "timeout",
2461 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION
, "time_audit",
2462 &vfs_time_audit_fns
);