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"
31 #include "lib/util/tevent_unix.h"
34 #define DBGC_CLASS DBGC_VFS
36 static double audit_timeout
;
38 static void smb_time_audit_log(const char *syscallname
, double elapsed
)
40 DEBUG(0, ("WARNING: System call \"%s\" took unexpectedly long "
41 "(%.2f seconds) -- Validate that file and storage "
42 "subsystems are operating normally\n", syscallname
,
46 static int smb_time_audit_connect(vfs_handle_struct
*handle
,
47 const char *svc
, const char *user
)
50 struct timespec ts1
,ts2
;
57 clock_gettime_mono(&ts1
);
58 result
= SMB_VFS_NEXT_CONNECT(handle
, svc
, user
);
59 clock_gettime_mono(&ts2
);
60 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
61 if (timediff
> audit_timeout
) {
62 smb_time_audit_log("connect", timediff
);
67 static void smb_time_audit_disconnect(vfs_handle_struct
*handle
)
69 struct timespec ts1
,ts2
;
72 clock_gettime_mono(&ts1
);
73 SMB_VFS_NEXT_DISCONNECT(handle
);
74 clock_gettime_mono(&ts2
);
75 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
77 if (timediff
> audit_timeout
) {
78 smb_time_audit_log("disconnect", timediff
);
84 static uint64_t smb_time_audit_disk_free(vfs_handle_struct
*handle
,
86 bool small_query
, uint64_t *bsize
,
87 uint64_t *dfree
, uint64_t *dsize
)
90 struct timespec ts1
,ts2
;
93 clock_gettime_mono(&ts1
);
94 result
= SMB_VFS_NEXT_DISK_FREE(handle
, path
, small_query
, bsize
,
96 clock_gettime_mono(&ts2
);
97 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
99 /* Don't have a reasonable notion of failure here */
100 if (timediff
> audit_timeout
) {
101 smb_time_audit_log("disk_free", timediff
);
107 static int smb_time_audit_get_quota(struct vfs_handle_struct
*handle
,
108 enum SMB_QUOTA_TYPE qtype
, unid_t id
,
112 struct timespec ts1
,ts2
;
115 clock_gettime_mono(&ts1
);
116 result
= SMB_VFS_NEXT_GET_QUOTA(handle
, qtype
, id
, qt
);
117 clock_gettime_mono(&ts2
);
118 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
120 if (timediff
> audit_timeout
) {
121 smb_time_audit_log("get_quota", timediff
);
126 static int smb_time_audit_set_quota(struct vfs_handle_struct
*handle
,
127 enum SMB_QUOTA_TYPE qtype
, unid_t id
,
131 struct timespec ts1
,ts2
;
134 clock_gettime_mono(&ts1
);
135 result
= SMB_VFS_NEXT_SET_QUOTA(handle
, qtype
, id
, qt
);
136 clock_gettime_mono(&ts2
);
137 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
139 if (timediff
> audit_timeout
) {
140 smb_time_audit_log("set_quota", timediff
);
146 static int smb_time_audit_get_shadow_copy_data(struct vfs_handle_struct
*handle
,
147 struct files_struct
*fsp
,
148 struct shadow_copy_data
*shadow_copy_data
,
152 struct timespec ts1
,ts2
;
155 clock_gettime_mono(&ts1
);
156 result
= SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle
, fsp
,
157 shadow_copy_data
, labels
);
158 clock_gettime_mono(&ts2
);
159 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
161 if (timediff
> audit_timeout
) {
162 smb_time_audit_log("get_shadow_copy_data", timediff
);
168 static int smb_time_audit_statvfs(struct vfs_handle_struct
*handle
,
170 struct vfs_statvfs_struct
*statbuf
)
173 struct timespec ts1
,ts2
;
176 clock_gettime_mono(&ts1
);
177 result
= SMB_VFS_NEXT_STATVFS(handle
, path
, statbuf
);
178 clock_gettime_mono(&ts2
);
179 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
181 if (timediff
> audit_timeout
) {
182 smb_time_audit_log("statvfs", timediff
);
188 static uint32_t smb_time_audit_fs_capabilities(struct vfs_handle_struct
*handle
,
189 enum timestamp_set_resolution
*p_ts_res
)
192 struct timespec ts1
,ts2
;
195 clock_gettime_mono(&ts1
);
196 result
= SMB_VFS_NEXT_FS_CAPABILITIES(handle
, p_ts_res
);
197 clock_gettime_mono(&ts2
);
198 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
200 if (timediff
> audit_timeout
) {
201 smb_time_audit_log("fs_capabilities", timediff
);
207 static DIR *smb_time_audit_opendir(vfs_handle_struct
*handle
,
209 const char *mask
, uint32 attr
)
212 struct timespec ts1
,ts2
;
215 clock_gettime_mono(&ts1
);
216 result
= SMB_VFS_NEXT_OPENDIR(handle
, fname
, mask
, attr
);
217 clock_gettime_mono(&ts2
);
218 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
220 if (timediff
> audit_timeout
) {
221 smb_time_audit_log("opendir", timediff
);
227 static DIR *smb_time_audit_fdopendir(vfs_handle_struct
*handle
,
229 const char *mask
, uint32 attr
)
232 struct timespec ts1
,ts2
;
235 clock_gettime_mono(&ts1
);
236 result
= SMB_VFS_NEXT_FDOPENDIR(handle
, fsp
, mask
, attr
);
237 clock_gettime_mono(&ts2
);
238 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
240 if (timediff
> audit_timeout
) {
241 smb_time_audit_log("fdopendir", timediff
);
247 static struct dirent
*smb_time_audit_readdir(vfs_handle_struct
*handle
,
249 SMB_STRUCT_STAT
*sbuf
)
251 struct dirent
*result
;
252 struct timespec ts1
,ts2
;
255 clock_gettime_mono(&ts1
);
256 result
= SMB_VFS_NEXT_READDIR(handle
, dirp
, sbuf
);
257 clock_gettime_mono(&ts2
);
258 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
260 if (timediff
> audit_timeout
) {
261 smb_time_audit_log("readdir", timediff
);
267 static void smb_time_audit_seekdir(vfs_handle_struct
*handle
,
268 DIR *dirp
, long offset
)
270 struct timespec ts1
,ts2
;
273 clock_gettime_mono(&ts1
);
274 SMB_VFS_NEXT_SEEKDIR(handle
, dirp
, offset
);
275 clock_gettime_mono(&ts2
);
276 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
278 if (timediff
> audit_timeout
) {
279 smb_time_audit_log("seekdir", timediff
);
285 static long smb_time_audit_telldir(vfs_handle_struct
*handle
,
289 struct timespec ts1
,ts2
;
292 clock_gettime_mono(&ts1
);
293 result
= SMB_VFS_NEXT_TELLDIR(handle
, dirp
);
294 clock_gettime_mono(&ts2
);
295 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
297 if (timediff
> audit_timeout
) {
298 smb_time_audit_log("telldir", timediff
);
304 static void smb_time_audit_rewinddir(vfs_handle_struct
*handle
,
307 struct timespec ts1
,ts2
;
310 clock_gettime_mono(&ts1
);
311 SMB_VFS_NEXT_REWINDDIR(handle
, dirp
);
312 clock_gettime_mono(&ts2
);
313 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
315 if (timediff
> audit_timeout
) {
316 smb_time_audit_log("rewinddir", timediff
);
322 static int smb_time_audit_mkdir(vfs_handle_struct
*handle
,
323 const char *path
, mode_t mode
)
326 struct timespec ts1
,ts2
;
329 clock_gettime_mono(&ts1
);
330 result
= SMB_VFS_NEXT_MKDIR(handle
, path
, mode
);
331 clock_gettime_mono(&ts2
);
332 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
334 if (timediff
> audit_timeout
) {
335 smb_time_audit_log("mkdir", timediff
);
341 static int smb_time_audit_rmdir(vfs_handle_struct
*handle
,
345 struct timespec ts1
,ts2
;
348 clock_gettime_mono(&ts1
);
349 result
= SMB_VFS_NEXT_RMDIR(handle
, path
);
350 clock_gettime_mono(&ts2
);
351 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
353 if (timediff
> audit_timeout
) {
354 smb_time_audit_log("rmdir", timediff
);
360 static int smb_time_audit_closedir(vfs_handle_struct
*handle
,
364 struct timespec ts1
,ts2
;
367 clock_gettime_mono(&ts1
);
368 result
= SMB_VFS_NEXT_CLOSEDIR(handle
, dirp
);
369 clock_gettime_mono(&ts2
);
370 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
372 if (timediff
> audit_timeout
) {
373 smb_time_audit_log("closedir", timediff
);
379 static void smb_time_audit_init_search_op(vfs_handle_struct
*handle
,
382 struct timespec ts1
,ts2
;
385 clock_gettime_mono(&ts1
);
386 SMB_VFS_NEXT_INIT_SEARCH_OP(handle
, dirp
);
387 clock_gettime_mono(&ts2
);
388 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
390 if (timediff
> audit_timeout
) {
391 smb_time_audit_log("init_search_op", timediff
);
396 static int smb_time_audit_open(vfs_handle_struct
*handle
,
397 struct smb_filename
*fname
,
399 int flags
, mode_t mode
)
402 struct timespec ts1
,ts2
;
405 clock_gettime_mono(&ts1
);
406 result
= SMB_VFS_NEXT_OPEN(handle
, fname
, fsp
, flags
, mode
);
407 clock_gettime_mono(&ts2
);
408 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
410 if (timediff
> audit_timeout
) {
411 smb_time_audit_log("open", timediff
);
417 static NTSTATUS
smb_time_audit_create_file(vfs_handle_struct
*handle
,
418 struct smb_request
*req
,
419 uint16_t root_dir_fid
,
420 struct smb_filename
*fname
,
421 uint32_t access_mask
,
422 uint32_t share_access
,
423 uint32_t create_disposition
,
424 uint32_t create_options
,
425 uint32_t file_attributes
,
426 uint32_t oplock_request
,
427 uint64_t allocation_size
,
428 uint32_t private_flags
,
429 struct security_descriptor
*sd
,
430 struct ea_list
*ea_list
,
431 files_struct
**result_fsp
,
435 struct timespec ts1
,ts2
;
438 clock_gettime_mono(&ts1
);
439 result
= SMB_VFS_NEXT_CREATE_FILE(
442 root_dir_fid
, /* root_dir_fid */
444 access_mask
, /* access_mask */
445 share_access
, /* share_access */
446 create_disposition
, /* create_disposition*/
447 create_options
, /* create_options */
448 file_attributes
, /* file_attributes */
449 oplock_request
, /* oplock_request */
450 allocation_size
, /* allocation_size */
453 ea_list
, /* ea_list */
454 result_fsp
, /* result */
456 clock_gettime_mono(&ts2
);
457 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
459 if (timediff
> audit_timeout
) {
460 smb_time_audit_log("create_file", timediff
);
466 static int smb_time_audit_close(vfs_handle_struct
*handle
, files_struct
*fsp
)
469 struct timespec ts1
,ts2
;
472 clock_gettime_mono(&ts1
);
473 result
= SMB_VFS_NEXT_CLOSE(handle
, fsp
);
474 clock_gettime_mono(&ts2
);
475 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
477 if (timediff
> audit_timeout
) {
478 smb_time_audit_log("close", timediff
);
484 static ssize_t
smb_time_audit_read(vfs_handle_struct
*handle
,
485 files_struct
*fsp
, void *data
, size_t n
)
488 struct timespec ts1
,ts2
;
491 clock_gettime_mono(&ts1
);
492 result
= SMB_VFS_NEXT_READ(handle
, fsp
, data
, n
);
493 clock_gettime_mono(&ts2
);
494 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
496 if (timediff
> audit_timeout
) {
497 smb_time_audit_log("read", timediff
);
503 static ssize_t
smb_time_audit_pread(vfs_handle_struct
*handle
,
505 void *data
, size_t n
, off_t offset
)
508 struct timespec ts1
,ts2
;
511 clock_gettime_mono(&ts1
);
512 result
= SMB_VFS_NEXT_PREAD(handle
, fsp
, data
, n
, offset
);
513 clock_gettime_mono(&ts2
);
514 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
516 if (timediff
> audit_timeout
) {
517 smb_time_audit_log("pread", timediff
);
523 struct smb_time_audit_pread_state
{
529 static void smb_time_audit_pread_done(struct tevent_req
*subreq
);
531 static struct tevent_req
*smb_time_audit_pread_send(
532 struct vfs_handle_struct
*handle
, TALLOC_CTX
*mem_ctx
,
533 struct tevent_context
*ev
, struct files_struct
*fsp
,
534 void *data
, size_t n
, off_t offset
)
536 struct tevent_req
*req
, *subreq
;
537 struct smb_time_audit_pread_state
*state
;
539 req
= tevent_req_create(mem_ctx
, &state
,
540 struct smb_time_audit_pread_state
);
544 clock_gettime_mono(&state
->ts1
);
546 subreq
= SMB_VFS_NEXT_PREAD_SEND(state
, ev
, handle
, fsp
, data
,
548 if (tevent_req_nomem(subreq
, req
)) {
549 return tevent_req_post(req
, ev
);
551 tevent_req_set_callback(subreq
, smb_time_audit_pread_done
, req
);
555 static void smb_time_audit_pread_done(struct tevent_req
*subreq
)
557 struct tevent_req
*req
= tevent_req_callback_data(
558 subreq
, struct tevent_req
);
559 struct smb_time_audit_pread_state
*state
= tevent_req_data(
560 req
, struct smb_time_audit_pread_state
);
562 state
->ret
= SMB_VFS_PREAD_RECV(subreq
, &state
->err
);
564 tevent_req_done(req
);
567 static ssize_t
smb_time_audit_pread_recv(struct tevent_req
*req
, int *err
)
569 struct smb_time_audit_pread_state
*state
= tevent_req_data(
570 req
, struct smb_time_audit_pread_state
);
574 clock_gettime_mono(&ts2
);
575 timediff
= nsec_time_diff(&ts2
,&state
->ts1
)*1.0e-9;
577 if (timediff
> audit_timeout
) {
578 smb_time_audit_log("pread", timediff
);
581 if (tevent_req_is_unix_error(req
, err
)) {
588 static ssize_t
smb_time_audit_write(vfs_handle_struct
*handle
,
590 const void *data
, size_t n
)
593 struct timespec ts1
,ts2
;
596 clock_gettime_mono(&ts1
);
597 result
= SMB_VFS_NEXT_WRITE(handle
, fsp
, data
, n
);
598 clock_gettime_mono(&ts2
);
599 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
601 if (timediff
> audit_timeout
) {
602 smb_time_audit_log("write", timediff
);
608 static ssize_t
smb_time_audit_pwrite(vfs_handle_struct
*handle
,
610 const void *data
, size_t n
,
614 struct timespec ts1
,ts2
;
617 clock_gettime_mono(&ts1
);
618 result
= SMB_VFS_NEXT_PWRITE(handle
, fsp
, data
, n
, offset
);
619 clock_gettime_mono(&ts2
);
620 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
622 if (timediff
> audit_timeout
) {
623 smb_time_audit_log("pwrite", timediff
);
629 static off_t
smb_time_audit_lseek(vfs_handle_struct
*handle
,
631 off_t offset
, int whence
)
634 struct timespec ts1
,ts2
;
637 clock_gettime_mono(&ts1
);
638 result
= SMB_VFS_NEXT_LSEEK(handle
, fsp
, offset
, whence
);
639 clock_gettime_mono(&ts2
);
640 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
642 if (timediff
> audit_timeout
) {
643 smb_time_audit_log("lseek", timediff
);
649 static ssize_t
smb_time_audit_sendfile(vfs_handle_struct
*handle
, int tofd
,
650 files_struct
*fromfsp
,
651 const DATA_BLOB
*hdr
, off_t offset
,
655 struct timespec ts1
,ts2
;
658 clock_gettime_mono(&ts1
);
659 result
= SMB_VFS_NEXT_SENDFILE(handle
, tofd
, fromfsp
, hdr
, offset
, n
);
660 clock_gettime_mono(&ts2
);
661 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
663 if (timediff
> audit_timeout
) {
664 smb_time_audit_log("sendfile", timediff
);
670 static ssize_t
smb_time_audit_recvfile(vfs_handle_struct
*handle
, int fromfd
,
676 struct timespec ts1
,ts2
;
679 clock_gettime_mono(&ts1
);
680 result
= SMB_VFS_NEXT_RECVFILE(handle
, fromfd
, tofsp
, offset
, n
);
681 clock_gettime_mono(&ts2
);
682 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
684 if (timediff
> audit_timeout
) {
685 smb_time_audit_log("recvfile", timediff
);
691 static int smb_time_audit_rename(vfs_handle_struct
*handle
,
692 const struct smb_filename
*oldname
,
693 const struct smb_filename
*newname
)
696 struct timespec ts1
,ts2
;
699 clock_gettime_mono(&ts1
);
700 result
= SMB_VFS_NEXT_RENAME(handle
, oldname
, newname
);
701 clock_gettime_mono(&ts2
);
702 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
704 if (timediff
> audit_timeout
) {
705 smb_time_audit_log("rename", timediff
);
711 static int smb_time_audit_fsync(vfs_handle_struct
*handle
, files_struct
*fsp
)
714 struct timespec ts1
,ts2
;
717 clock_gettime_mono(&ts1
);
718 result
= SMB_VFS_NEXT_FSYNC(handle
, fsp
);
719 clock_gettime_mono(&ts2
);
720 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
722 if (timediff
> audit_timeout
) {
723 smb_time_audit_log("fsync", timediff
);
729 static int smb_time_audit_stat(vfs_handle_struct
*handle
,
730 struct smb_filename
*fname
)
733 struct timespec ts1
,ts2
;
736 clock_gettime_mono(&ts1
);
737 result
= SMB_VFS_NEXT_STAT(handle
, fname
);
738 clock_gettime_mono(&ts2
);
739 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
741 if (timediff
> audit_timeout
) {
742 smb_time_audit_log("stat", timediff
);
748 static int smb_time_audit_fstat(vfs_handle_struct
*handle
, files_struct
*fsp
,
749 SMB_STRUCT_STAT
*sbuf
)
752 struct timespec ts1
,ts2
;
755 clock_gettime_mono(&ts1
);
756 result
= SMB_VFS_NEXT_FSTAT(handle
, fsp
, sbuf
);
757 clock_gettime_mono(&ts2
);
758 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
760 if (timediff
> audit_timeout
) {
761 smb_time_audit_log("fstat", timediff
);
767 static int smb_time_audit_lstat(vfs_handle_struct
*handle
,
768 struct smb_filename
*path
)
771 struct timespec ts1
,ts2
;
774 clock_gettime_mono(&ts1
);
775 result
= SMB_VFS_NEXT_LSTAT(handle
, path
);
776 clock_gettime_mono(&ts2
);
777 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
779 if (timediff
> audit_timeout
) {
780 smb_time_audit_log("lstat", timediff
);
786 static uint64_t smb_time_audit_get_alloc_size(vfs_handle_struct
*handle
,
788 const SMB_STRUCT_STAT
*sbuf
)
791 struct timespec ts1
,ts2
;
794 clock_gettime_mono(&ts1
);
795 result
= SMB_VFS_NEXT_GET_ALLOC_SIZE(handle
, fsp
, sbuf
);
796 clock_gettime_mono(&ts2
);
797 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
799 if (timediff
> audit_timeout
) {
800 smb_time_audit_log("get_alloc_size", timediff
);
806 static int smb_time_audit_unlink(vfs_handle_struct
*handle
,
807 const struct smb_filename
*path
)
810 struct timespec ts1
,ts2
;
813 clock_gettime_mono(&ts1
);
814 result
= SMB_VFS_NEXT_UNLINK(handle
, path
);
815 clock_gettime_mono(&ts2
);
816 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
818 if (timediff
> audit_timeout
) {
819 smb_time_audit_log("unlink", timediff
);
825 static int smb_time_audit_chmod(vfs_handle_struct
*handle
,
826 const char *path
, mode_t mode
)
829 struct timespec ts1
,ts2
;
832 clock_gettime_mono(&ts1
);
833 result
= SMB_VFS_NEXT_CHMOD(handle
, path
, mode
);
834 clock_gettime_mono(&ts2
);
835 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
837 if (timediff
> audit_timeout
) {
838 smb_time_audit_log("chmod", timediff
);
844 static int smb_time_audit_fchmod(vfs_handle_struct
*handle
, files_struct
*fsp
,
848 struct timespec ts1
,ts2
;
851 clock_gettime_mono(&ts1
);
852 result
= SMB_VFS_NEXT_FCHMOD(handle
, fsp
, mode
);
853 clock_gettime_mono(&ts2
);
854 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
856 if (timediff
> audit_timeout
) {
857 smb_time_audit_log("fchmod", timediff
);
863 static int smb_time_audit_chown(vfs_handle_struct
*handle
,
864 const char *path
, uid_t uid
, gid_t gid
)
867 struct timespec ts1
,ts2
;
870 clock_gettime_mono(&ts1
);
871 result
= SMB_VFS_NEXT_CHOWN(handle
, path
, uid
, gid
);
872 clock_gettime_mono(&ts2
);
873 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
875 if (timediff
> audit_timeout
) {
876 smb_time_audit_log("chown", timediff
);
882 static int smb_time_audit_fchown(vfs_handle_struct
*handle
, files_struct
*fsp
,
883 uid_t uid
, gid_t gid
)
886 struct timespec ts1
,ts2
;
889 clock_gettime_mono(&ts1
);
890 result
= SMB_VFS_NEXT_FCHOWN(handle
, fsp
, uid
, gid
);
891 clock_gettime_mono(&ts2
);
892 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
894 if (timediff
> audit_timeout
) {
895 smb_time_audit_log("fchown", timediff
);
901 static int smb_time_audit_lchown(vfs_handle_struct
*handle
,
902 const char *path
, uid_t uid
, gid_t gid
)
905 struct timespec ts1
,ts2
;
908 clock_gettime_mono(&ts1
);
909 result
= SMB_VFS_NEXT_LCHOWN(handle
, path
, uid
, gid
);
910 clock_gettime_mono(&ts2
);
911 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
913 if (timediff
> audit_timeout
) {
914 smb_time_audit_log("lchown", timediff
);
920 static int smb_time_audit_chdir(vfs_handle_struct
*handle
, const char *path
)
923 struct timespec ts1
,ts2
;
926 clock_gettime_mono(&ts1
);
927 result
= SMB_VFS_NEXT_CHDIR(handle
, path
);
928 clock_gettime_mono(&ts2
);
929 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
931 if (timediff
> audit_timeout
) {
932 smb_time_audit_log("chdir", timediff
);
938 static char *smb_time_audit_getwd(vfs_handle_struct
*handle
)
941 struct timespec ts1
,ts2
;
944 clock_gettime_mono(&ts1
);
945 result
= SMB_VFS_NEXT_GETWD(handle
);
946 clock_gettime_mono(&ts2
);
947 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
949 if (timediff
> audit_timeout
) {
950 smb_time_audit_log("getwd", timediff
);
956 static int smb_time_audit_ntimes(vfs_handle_struct
*handle
,
957 const struct smb_filename
*path
,
958 struct smb_file_time
*ft
)
961 struct timespec ts1
,ts2
;
964 clock_gettime_mono(&ts1
);
965 result
= SMB_VFS_NEXT_NTIMES(handle
, path
, ft
);
966 clock_gettime_mono(&ts2
);
967 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
969 if (timediff
> audit_timeout
) {
970 smb_time_audit_log("ntimes", timediff
);
976 static int smb_time_audit_ftruncate(vfs_handle_struct
*handle
,
981 struct timespec ts1
,ts2
;
984 clock_gettime_mono(&ts1
);
985 result
= SMB_VFS_NEXT_FTRUNCATE(handle
, fsp
, len
);
986 clock_gettime_mono(&ts2
);
987 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
989 if (timediff
> audit_timeout
) {
990 smb_time_audit_log("ftruncate", timediff
);
996 static int smb_time_audit_fallocate(vfs_handle_struct
*handle
,
998 enum vfs_fallocate_mode mode
,
1003 struct timespec ts1
,ts2
;
1006 clock_gettime_mono(&ts1
);
1007 result
= SMB_VFS_NEXT_FALLOCATE(handle
, fsp
, mode
, offset
, len
);
1008 clock_gettime_mono(&ts2
);
1009 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1011 if (timediff
> audit_timeout
) {
1012 smb_time_audit_log("fallocate", timediff
);
1018 static bool smb_time_audit_lock(vfs_handle_struct
*handle
, files_struct
*fsp
,
1019 int op
, off_t offset
, off_t count
,
1023 struct timespec ts1
,ts2
;
1026 clock_gettime_mono(&ts1
);
1027 result
= SMB_VFS_NEXT_LOCK(handle
, fsp
, op
, offset
, count
, type
);
1028 clock_gettime_mono(&ts2
);
1029 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1031 if (timediff
> audit_timeout
) {
1032 smb_time_audit_log("lock", timediff
);
1038 static int smb_time_audit_kernel_flock(struct vfs_handle_struct
*handle
,
1039 struct files_struct
*fsp
,
1040 uint32 share_mode
, uint32 access_mask
)
1043 struct timespec ts1
,ts2
;
1046 clock_gettime_mono(&ts1
);
1047 result
= SMB_VFS_NEXT_KERNEL_FLOCK(handle
, fsp
, share_mode
,
1049 clock_gettime_mono(&ts2
);
1050 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1052 if (timediff
> audit_timeout
) {
1053 smb_time_audit_log("kernel_flock", timediff
);
1059 static int smb_time_audit_linux_setlease(vfs_handle_struct
*handle
,
1064 struct timespec ts1
,ts2
;
1067 clock_gettime_mono(&ts1
);
1068 result
= SMB_VFS_NEXT_LINUX_SETLEASE(handle
, fsp
, leasetype
);
1069 clock_gettime_mono(&ts2
);
1070 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1072 if (timediff
> audit_timeout
) {
1073 smb_time_audit_log("linux_setlease", timediff
);
1079 static bool smb_time_audit_getlock(vfs_handle_struct
*handle
,
1081 off_t
*poffset
, off_t
*pcount
,
1082 int *ptype
, pid_t
*ppid
)
1085 struct timespec ts1
,ts2
;
1088 clock_gettime_mono(&ts1
);
1089 result
= SMB_VFS_NEXT_GETLOCK(handle
, fsp
, poffset
, pcount
, ptype
,
1091 clock_gettime_mono(&ts2
);
1092 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1094 if (timediff
> audit_timeout
) {
1095 smb_time_audit_log("getlock", timediff
);
1101 static int smb_time_audit_symlink(vfs_handle_struct
*handle
,
1102 const char *oldpath
, const char *newpath
)
1105 struct timespec ts1
,ts2
;
1108 clock_gettime_mono(&ts1
);
1109 result
= SMB_VFS_NEXT_SYMLINK(handle
, oldpath
, newpath
);
1110 clock_gettime_mono(&ts2
);
1111 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1113 if (timediff
> audit_timeout
) {
1114 smb_time_audit_log("symlink", timediff
);
1120 static int smb_time_audit_readlink(vfs_handle_struct
*handle
,
1121 const char *path
, char *buf
, size_t bufsiz
)
1124 struct timespec ts1
,ts2
;
1127 clock_gettime_mono(&ts1
);
1128 result
= SMB_VFS_NEXT_READLINK(handle
, path
, buf
, bufsiz
);
1129 clock_gettime_mono(&ts2
);
1130 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1132 if (timediff
> audit_timeout
) {
1133 smb_time_audit_log("readlink", timediff
);
1139 static int smb_time_audit_link(vfs_handle_struct
*handle
,
1140 const char *oldpath
, const char *newpath
)
1143 struct timespec ts1
,ts2
;
1146 clock_gettime_mono(&ts1
);
1147 result
= SMB_VFS_NEXT_LINK(handle
, oldpath
, newpath
);
1148 clock_gettime_mono(&ts2
);
1149 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1151 if (timediff
> audit_timeout
) {
1152 smb_time_audit_log("link", timediff
);
1158 static int smb_time_audit_mknod(vfs_handle_struct
*handle
,
1159 const char *pathname
, mode_t mode
,
1163 struct timespec ts1
,ts2
;
1166 clock_gettime_mono(&ts1
);
1167 result
= SMB_VFS_NEXT_MKNOD(handle
, pathname
, mode
, dev
);
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("mknod", timediff
);
1178 static char *smb_time_audit_realpath(vfs_handle_struct
*handle
,
1182 struct timespec ts1
,ts2
;
1185 clock_gettime_mono(&ts1
);
1186 result
= SMB_VFS_NEXT_REALPATH(handle
, path
);
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("realpath", timediff
);
1197 static NTSTATUS
smb_time_audit_notify_watch(struct vfs_handle_struct
*handle
,
1198 struct sys_notify_context
*ctx
,
1201 uint32_t *subdir_filter
,
1202 void (*callback
)(struct sys_notify_context
*ctx
,
1204 struct notify_event
*ev
),
1205 void *private_data
, void *handle_p
)
1208 struct timespec ts1
,ts2
;
1211 clock_gettime_mono(&ts1
);
1212 result
= SMB_VFS_NEXT_NOTIFY_WATCH(handle
, ctx
, path
,
1213 filter
, subdir_filter
, callback
,
1214 private_data
, handle_p
);
1215 clock_gettime_mono(&ts2
);
1216 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1218 if (timediff
> audit_timeout
) {
1219 smb_time_audit_log("notify_watch", timediff
);
1225 static int smb_time_audit_chflags(vfs_handle_struct
*handle
,
1226 const char *path
, unsigned int flags
)
1229 struct timespec ts1
,ts2
;
1232 clock_gettime_mono(&ts1
);
1233 result
= SMB_VFS_NEXT_CHFLAGS(handle
, path
, flags
);
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("chflags", timediff
);
1244 static struct file_id
smb_time_audit_file_id_create(struct vfs_handle_struct
*handle
,
1245 const SMB_STRUCT_STAT
*sbuf
)
1247 struct file_id id_zero
;
1248 struct file_id result
;
1249 struct timespec ts1
,ts2
;
1252 ZERO_STRUCT(id_zero
);
1254 clock_gettime_mono(&ts1
);
1255 result
= SMB_VFS_NEXT_FILE_ID_CREATE(handle
, sbuf
);
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("file_id_create", timediff
);
1266 static NTSTATUS
smb_time_audit_streaminfo(vfs_handle_struct
*handle
,
1267 struct files_struct
*fsp
,
1269 TALLOC_CTX
*mem_ctx
,
1270 unsigned int *pnum_streams
,
1271 struct stream_struct
**pstreams
)
1274 struct timespec ts1
,ts2
;
1277 clock_gettime_mono(&ts1
);
1278 result
= SMB_VFS_NEXT_STREAMINFO(handle
, fsp
, fname
, mem_ctx
,
1279 pnum_streams
, pstreams
);
1280 clock_gettime_mono(&ts2
);
1281 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1283 if (timediff
> audit_timeout
) {
1284 smb_time_audit_log("streaminfo", timediff
);
1290 static int smb_time_audit_get_real_filename(struct vfs_handle_struct
*handle
,
1293 TALLOC_CTX
*mem_ctx
,
1297 struct timespec ts1
,ts2
;
1300 clock_gettime_mono(&ts1
);
1301 result
= SMB_VFS_NEXT_GET_REAL_FILENAME(handle
, path
, name
, mem_ctx
,
1303 clock_gettime_mono(&ts2
);
1304 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1306 if (timediff
> audit_timeout
) {
1307 smb_time_audit_log("get_real_filename", timediff
);
1313 static const char *smb_time_audit_connectpath(vfs_handle_struct
*handle
,
1317 struct timespec ts1
,ts2
;
1320 clock_gettime_mono(&ts1
);
1321 result
= SMB_VFS_NEXT_CONNECTPATH(handle
, fname
);
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("connectpath", timediff
);
1332 static NTSTATUS
smb_time_audit_brl_lock_windows(struct vfs_handle_struct
*handle
,
1333 struct byte_range_lock
*br_lck
,
1334 struct lock_struct
*plock
,
1336 struct blocking_lock_record
*blr
)
1339 struct timespec ts1
,ts2
;
1342 clock_gettime_mono(&ts1
);
1343 result
= SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle
, br_lck
, plock
,
1344 blocking_lock
, blr
);
1345 clock_gettime_mono(&ts2
);
1346 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1348 if (timediff
> audit_timeout
) {
1349 smb_time_audit_log("brl_lock_windows", timediff
);
1355 static bool smb_time_audit_brl_unlock_windows(struct vfs_handle_struct
*handle
,
1356 struct messaging_context
*msg_ctx
,
1357 struct byte_range_lock
*br_lck
,
1358 const struct lock_struct
*plock
)
1361 struct timespec ts1
,ts2
;
1364 clock_gettime_mono(&ts1
);
1365 result
= SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle
, msg_ctx
, br_lck
,
1367 clock_gettime_mono(&ts2
);
1368 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1370 if (timediff
> audit_timeout
) {
1371 smb_time_audit_log("brl_unlock_windows", timediff
);
1377 static bool smb_time_audit_brl_cancel_windows(struct vfs_handle_struct
*handle
,
1378 struct byte_range_lock
*br_lck
,
1379 struct lock_struct
*plock
,
1380 struct blocking_lock_record
*blr
)
1383 struct timespec ts1
,ts2
;
1386 clock_gettime_mono(&ts1
);
1387 result
= SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle
, br_lck
, plock
, blr
);
1388 clock_gettime_mono(&ts2
);
1389 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1391 if (timediff
> audit_timeout
) {
1392 smb_time_audit_log("brl_cancel_windows", timediff
);
1398 static bool smb_time_audit_strict_lock(struct vfs_handle_struct
*handle
,
1399 struct files_struct
*fsp
,
1400 struct lock_struct
*plock
)
1403 struct timespec ts1
,ts2
;
1406 clock_gettime_mono(&ts1
);
1407 result
= SMB_VFS_NEXT_STRICT_LOCK(handle
, fsp
, plock
);
1408 clock_gettime_mono(&ts2
);
1409 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1411 if (timediff
> audit_timeout
) {
1412 smb_time_audit_log("strict_lock", timediff
);
1418 static void smb_time_audit_strict_unlock(struct vfs_handle_struct
*handle
,
1419 struct files_struct
*fsp
,
1420 struct lock_struct
*plock
)
1422 struct timespec ts1
,ts2
;
1425 clock_gettime_mono(&ts1
);
1426 SMB_VFS_NEXT_STRICT_UNLOCK(handle
, fsp
, plock
);
1427 clock_gettime_mono(&ts2
);
1428 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1430 if (timediff
> audit_timeout
) {
1431 smb_time_audit_log("strict_unlock", timediff
);
1437 static NTSTATUS
smb_time_audit_translate_name(struct vfs_handle_struct
*handle
,
1439 enum vfs_translate_direction direction
,
1440 TALLOC_CTX
*mem_ctx
,
1444 struct timespec ts1
,ts2
;
1447 clock_gettime_mono(&ts1
);
1448 result
= SMB_VFS_NEXT_TRANSLATE_NAME(handle
, name
, direction
, mem_ctx
,
1450 clock_gettime_mono(&ts2
);
1451 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1453 if (timediff
> audit_timeout
) {
1454 smb_time_audit_log("translate_name", timediff
);
1460 static NTSTATUS
smb_time_audit_fget_nt_acl(vfs_handle_struct
*handle
,
1462 uint32 security_info
,
1463 struct security_descriptor
**ppdesc
)
1466 struct timespec ts1
,ts2
;
1469 clock_gettime_mono(&ts1
);
1470 result
= SMB_VFS_NEXT_FGET_NT_ACL(handle
, fsp
, security_info
, ppdesc
);
1471 clock_gettime_mono(&ts2
);
1472 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1474 if (timediff
> audit_timeout
) {
1475 smb_time_audit_log("fget_nt_acl", timediff
);
1481 static NTSTATUS
smb_time_audit_get_nt_acl(vfs_handle_struct
*handle
,
1483 uint32 security_info
,
1484 struct security_descriptor
**ppdesc
)
1487 struct timespec ts1
,ts2
;
1490 clock_gettime_mono(&ts1
);
1491 result
= SMB_VFS_NEXT_GET_NT_ACL(handle
, name
, security_info
, ppdesc
);
1492 clock_gettime_mono(&ts2
);
1493 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1495 if (timediff
> audit_timeout
) {
1496 smb_time_audit_log("get_nt_acl", timediff
);
1502 static NTSTATUS
smb_time_audit_fset_nt_acl(vfs_handle_struct
*handle
,
1504 uint32 security_info_sent
,
1505 const struct security_descriptor
*psd
)
1508 struct timespec ts1
,ts2
;
1511 clock_gettime_mono(&ts1
);
1512 result
= SMB_VFS_NEXT_FSET_NT_ACL(handle
, fsp
, security_info_sent
,
1514 clock_gettime_mono(&ts2
);
1515 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1517 if (timediff
> audit_timeout
) {
1518 smb_time_audit_log("fset_nt_acl", timediff
);
1524 static int smb_time_audit_chmod_acl(vfs_handle_struct
*handle
,
1525 const char *path
, mode_t mode
)
1528 struct timespec ts1
,ts2
;
1531 clock_gettime_mono(&ts1
);
1532 result
= SMB_VFS_NEXT_CHMOD_ACL(handle
, path
, mode
);
1533 clock_gettime_mono(&ts2
);
1534 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1536 if (timediff
> audit_timeout
) {
1537 smb_time_audit_log("chmod_acl", timediff
);
1543 static int smb_time_audit_fchmod_acl(vfs_handle_struct
*handle
,
1544 files_struct
*fsp
, mode_t mode
)
1547 struct timespec ts1
,ts2
;
1550 clock_gettime_mono(&ts1
);
1551 result
= SMB_VFS_NEXT_FCHMOD_ACL(handle
, fsp
, mode
);
1552 clock_gettime_mono(&ts2
);
1553 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1555 if (timediff
> audit_timeout
) {
1556 smb_time_audit_log("fchmod_acl", timediff
);
1562 static int smb_time_audit_sys_acl_get_entry(vfs_handle_struct
*handle
,
1563 SMB_ACL_T theacl
, int entry_id
,
1564 SMB_ACL_ENTRY_T
*entry_p
)
1567 struct timespec ts1
,ts2
;
1570 clock_gettime_mono(&ts1
);
1571 result
= SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle
, theacl
, entry_id
,
1573 clock_gettime_mono(&ts2
);
1574 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1576 if (timediff
> audit_timeout
) {
1577 smb_time_audit_log("sys_acl_get_entry", timediff
);
1583 static int smb_time_audit_sys_acl_get_tag_type(vfs_handle_struct
*handle
,
1584 SMB_ACL_ENTRY_T entry_d
,
1585 SMB_ACL_TAG_T
*tag_type_p
)
1588 struct timespec ts1
,ts2
;
1591 clock_gettime_mono(&ts1
);
1592 result
= SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle
, entry_d
,
1594 clock_gettime_mono(&ts2
);
1595 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1597 if (timediff
> audit_timeout
) {
1598 smb_time_audit_log("sys_acl_get_tag_type", timediff
);
1604 static int smb_time_audit_sys_acl_get_permset(vfs_handle_struct
*handle
,
1605 SMB_ACL_ENTRY_T entry_d
,
1606 SMB_ACL_PERMSET_T
*permset_p
)
1609 struct timespec ts1
,ts2
;
1612 clock_gettime_mono(&ts1
);
1613 result
= SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle
, entry_d
,
1615 clock_gettime_mono(&ts2
);
1616 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1618 if (timediff
> audit_timeout
) {
1619 smb_time_audit_log("sys_acl_get_permset", timediff
);
1625 static void * smb_time_audit_sys_acl_get_qualifier(vfs_handle_struct
*handle
,
1626 SMB_ACL_ENTRY_T entry_d
)
1629 struct timespec ts1
,ts2
;
1632 clock_gettime_mono(&ts1
);
1633 result
= SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle
, entry_d
);
1634 clock_gettime_mono(&ts2
);
1635 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1637 if (timediff
> audit_timeout
) {
1638 smb_time_audit_log("sys_acl_get_qualifier", timediff
);
1644 static SMB_ACL_T
smb_time_audit_sys_acl_get_file(vfs_handle_struct
*handle
,
1646 SMB_ACL_TYPE_T type
)
1649 struct timespec ts1
,ts2
;
1652 clock_gettime_mono(&ts1
);
1653 result
= SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle
, path_p
, type
);
1654 clock_gettime_mono(&ts2
);
1655 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1657 if (timediff
> audit_timeout
) {
1658 smb_time_audit_log("sys_acl_get_file", timediff
);
1664 static SMB_ACL_T
smb_time_audit_sys_acl_get_fd(vfs_handle_struct
*handle
,
1668 struct timespec ts1
,ts2
;
1671 clock_gettime_mono(&ts1
);
1672 result
= SMB_VFS_NEXT_SYS_ACL_GET_FD(handle
, fsp
);
1673 clock_gettime_mono(&ts2
);
1674 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1676 if (timediff
> audit_timeout
) {
1677 smb_time_audit_log("sys_acl_get_fd", timediff
);
1683 static int smb_time_audit_sys_acl_clear_perms(vfs_handle_struct
*handle
,
1684 SMB_ACL_PERMSET_T permset
)
1687 struct timespec ts1
,ts2
;
1690 clock_gettime_mono(&ts1
);
1691 result
= SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle
, permset
);
1692 clock_gettime_mono(&ts2
);
1693 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1695 if (timediff
> audit_timeout
) {
1696 smb_time_audit_log("sys_acl_clear_perms", timediff
);
1702 static int smb_time_audit_sys_acl_add_perm(vfs_handle_struct
*handle
,
1703 SMB_ACL_PERMSET_T permset
,
1704 SMB_ACL_PERM_T perm
)
1707 struct timespec ts1
,ts2
;
1710 clock_gettime_mono(&ts1
);
1711 result
= SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle
, permset
, perm
);
1712 clock_gettime_mono(&ts2
);
1713 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1715 if (timediff
> audit_timeout
) {
1716 smb_time_audit_log("sys_acl_add_perm", timediff
);
1722 static char * smb_time_audit_sys_acl_to_text(vfs_handle_struct
*handle
,
1727 struct timespec ts1
,ts2
;
1730 clock_gettime_mono(&ts1
);
1731 result
= SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle
, theacl
, plen
);
1732 clock_gettime_mono(&ts2
);
1733 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1735 if (timediff
> audit_timeout
) {
1736 smb_time_audit_log("sys_acl_to_text", timediff
);
1742 static SMB_ACL_T
smb_time_audit_sys_acl_init(vfs_handle_struct
*handle
,
1746 struct timespec ts1
,ts2
;
1749 clock_gettime_mono(&ts1
);
1750 result
= SMB_VFS_NEXT_SYS_ACL_INIT(handle
, count
);
1751 clock_gettime_mono(&ts2
);
1752 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1754 if (timediff
> audit_timeout
) {
1755 smb_time_audit_log("sys_acl_init", timediff
);
1761 static int smb_time_audit_sys_acl_create_entry(vfs_handle_struct
*handle
,
1763 SMB_ACL_ENTRY_T
*pentry
)
1766 struct timespec ts1
,ts2
;
1769 clock_gettime_mono(&ts1
);
1770 result
= SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle
, pacl
, pentry
);
1771 clock_gettime_mono(&ts2
);
1772 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1774 if (timediff
> audit_timeout
) {
1775 smb_time_audit_log("sys_acl_create_entry", timediff
);
1781 static int smb_time_audit_sys_acl_set_tag_type(vfs_handle_struct
*handle
,
1782 SMB_ACL_ENTRY_T entry
,
1783 SMB_ACL_TAG_T tagtype
)
1786 struct timespec ts1
,ts2
;
1789 clock_gettime_mono(&ts1
);
1790 result
= SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle
, entry
,
1792 clock_gettime_mono(&ts2
);
1793 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1795 if (timediff
> audit_timeout
) {
1796 smb_time_audit_log("sys_acl_set_tag_type", timediff
);
1802 static int smb_time_audit_sys_acl_set_qualifier(vfs_handle_struct
*handle
,
1803 SMB_ACL_ENTRY_T entry
,
1807 struct timespec ts1
,ts2
;
1810 clock_gettime_mono(&ts1
);
1811 result
= SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle
, entry
, qual
);
1812 clock_gettime_mono(&ts2
);
1813 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1815 if (timediff
> audit_timeout
) {
1816 smb_time_audit_log("sys_acl_set_qualifier", timediff
);
1822 static int smb_time_audit_sys_acl_set_permset(vfs_handle_struct
*handle
,
1823 SMB_ACL_ENTRY_T entry
,
1824 SMB_ACL_PERMSET_T permset
)
1827 struct timespec ts1
,ts2
;
1830 clock_gettime_mono(&ts1
);
1831 result
= SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle
, entry
, permset
);
1832 clock_gettime_mono(&ts2
);
1833 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1835 if (timediff
> audit_timeout
) {
1836 smb_time_audit_log("sys_acl_set_permset", timediff
);
1842 static int smb_time_audit_sys_acl_valid(vfs_handle_struct
*handle
,
1846 struct timespec ts1
,ts2
;
1849 clock_gettime_mono(&ts1
);
1850 result
= SMB_VFS_NEXT_SYS_ACL_VALID(handle
, theacl
);
1851 clock_gettime_mono(&ts2
);
1852 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1854 if (timediff
> audit_timeout
) {
1855 smb_time_audit_log("sys_acl_valid", timediff
);
1861 static int smb_time_audit_sys_acl_set_file(vfs_handle_struct
*handle
,
1863 SMB_ACL_TYPE_T acltype
,
1867 struct timespec ts1
,ts2
;
1870 clock_gettime_mono(&ts1
);
1871 result
= SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle
, name
, acltype
,
1873 clock_gettime_mono(&ts2
);
1874 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1876 if (timediff
> audit_timeout
) {
1877 smb_time_audit_log("sys_acl_set_file", timediff
);
1883 static int smb_time_audit_sys_acl_set_fd(vfs_handle_struct
*handle
,
1888 struct timespec ts1
,ts2
;
1891 clock_gettime_mono(&ts1
);
1892 result
= SMB_VFS_NEXT_SYS_ACL_SET_FD(handle
, fsp
, theacl
);
1893 clock_gettime_mono(&ts2
);
1894 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1896 if (timediff
> audit_timeout
) {
1897 smb_time_audit_log("sys_acl_set_fd", timediff
);
1903 static int smb_time_audit_sys_acl_delete_def_file(vfs_handle_struct
*handle
,
1907 struct timespec ts1
,ts2
;
1910 clock_gettime_mono(&ts1
);
1911 result
= SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle
, path
);
1912 clock_gettime_mono(&ts2
);
1913 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1915 if (timediff
> audit_timeout
) {
1916 smb_time_audit_log("sys_acl_delete_def_file", timediff
);
1922 static int smb_time_audit_sys_acl_get_perm(vfs_handle_struct
*handle
,
1923 SMB_ACL_PERMSET_T permset
,
1924 SMB_ACL_PERM_T perm
)
1927 struct timespec ts1
,ts2
;
1930 clock_gettime_mono(&ts1
);
1931 result
= SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle
, permset
, perm
);
1932 clock_gettime_mono(&ts2
);
1933 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1935 if (timediff
> audit_timeout
) {
1936 smb_time_audit_log("sys_acl_get_perm", timediff
);
1942 static int smb_time_audit_sys_acl_free_text(vfs_handle_struct
*handle
,
1946 struct timespec ts1
,ts2
;
1949 clock_gettime_mono(&ts1
);
1950 result
= SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle
, text
);
1951 clock_gettime_mono(&ts2
);
1952 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1954 if (timediff
> audit_timeout
) {
1955 smb_time_audit_log("sys_acl_free_text", timediff
);
1961 static int smb_time_audit_sys_acl_free_acl(vfs_handle_struct
*handle
,
1962 SMB_ACL_T posix_acl
)
1965 struct timespec ts1
,ts2
;
1968 clock_gettime_mono(&ts1
);
1969 result
= SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle
, posix_acl
);
1970 clock_gettime_mono(&ts2
);
1971 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1973 if (timediff
> audit_timeout
) {
1974 smb_time_audit_log("sys_acl_free_acl", timediff
);
1980 static int smb_time_audit_sys_acl_free_qualifier(vfs_handle_struct
*handle
,
1982 SMB_ACL_TAG_T tagtype
)
1985 struct timespec ts1
,ts2
;
1988 clock_gettime_mono(&ts1
);
1989 result
= SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle
, qualifier
,
1991 clock_gettime_mono(&ts2
);
1992 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
1994 if (timediff
> audit_timeout
) {
1995 smb_time_audit_log("sys_acl_free_qualifier", timediff
);
2001 static ssize_t
smb_time_audit_getxattr(struct vfs_handle_struct
*handle
,
2002 const char *path
, const char *name
,
2003 void *value
, size_t size
)
2006 struct timespec ts1
,ts2
;
2009 clock_gettime_mono(&ts1
);
2010 result
= SMB_VFS_NEXT_GETXATTR(handle
, path
, name
, value
, size
);
2011 clock_gettime_mono(&ts2
);
2012 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2014 if (timediff
> audit_timeout
) {
2015 smb_time_audit_log("getxattr", timediff
);
2021 static ssize_t
smb_time_audit_fgetxattr(struct vfs_handle_struct
*handle
,
2022 struct files_struct
*fsp
,
2023 const char *name
, void *value
,
2027 struct timespec ts1
,ts2
;
2030 clock_gettime_mono(&ts1
);
2031 result
= SMB_VFS_NEXT_FGETXATTR(handle
, fsp
, name
, value
, size
);
2032 clock_gettime_mono(&ts2
);
2033 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2035 if (timediff
> audit_timeout
) {
2036 smb_time_audit_log("fgetxattr", timediff
);
2042 static ssize_t
smb_time_audit_listxattr(struct vfs_handle_struct
*handle
,
2043 const char *path
, char *list
,
2047 struct timespec ts1
,ts2
;
2050 clock_gettime_mono(&ts1
);
2051 result
= SMB_VFS_NEXT_LISTXATTR(handle
, path
, list
, size
);
2052 clock_gettime_mono(&ts2
);
2053 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2055 if (timediff
> audit_timeout
) {
2056 smb_time_audit_log("listxattr", timediff
);
2062 static ssize_t
smb_time_audit_flistxattr(struct vfs_handle_struct
*handle
,
2063 struct files_struct
*fsp
, char *list
,
2067 struct timespec ts1
,ts2
;
2070 clock_gettime_mono(&ts1
);
2071 result
= SMB_VFS_NEXT_FLISTXATTR(handle
, fsp
, list
, size
);
2072 clock_gettime_mono(&ts2
);
2073 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2075 if (timediff
> audit_timeout
) {
2076 smb_time_audit_log("flistxattr", timediff
);
2082 static int smb_time_audit_removexattr(struct vfs_handle_struct
*handle
,
2083 const char *path
, const char *name
)
2086 struct timespec ts1
,ts2
;
2089 clock_gettime_mono(&ts1
);
2090 result
= SMB_VFS_NEXT_REMOVEXATTR(handle
, path
, name
);
2091 clock_gettime_mono(&ts2
);
2092 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2094 if (timediff
> audit_timeout
) {
2095 smb_time_audit_log("removexattr", timediff
);
2101 static int smb_time_audit_fremovexattr(struct vfs_handle_struct
*handle
,
2102 struct files_struct
*fsp
,
2106 struct timespec ts1
,ts2
;
2109 clock_gettime_mono(&ts1
);
2110 result
= SMB_VFS_NEXT_FREMOVEXATTR(handle
, fsp
, name
);
2111 clock_gettime_mono(&ts2
);
2112 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2114 if (timediff
> audit_timeout
) {
2115 smb_time_audit_log("fremovexattr", timediff
);
2121 static int smb_time_audit_setxattr(struct vfs_handle_struct
*handle
,
2122 const char *path
, const char *name
,
2123 const void *value
, size_t size
,
2127 struct timespec ts1
,ts2
;
2130 clock_gettime_mono(&ts1
);
2131 result
= SMB_VFS_NEXT_SETXATTR(handle
, path
, name
, value
, size
,
2133 clock_gettime_mono(&ts2
);
2134 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2136 if (timediff
> audit_timeout
) {
2137 smb_time_audit_log("setxattr", timediff
);
2143 static int smb_time_audit_fsetxattr(struct vfs_handle_struct
*handle
,
2144 struct files_struct
*fsp
, const char *name
,
2145 const void *value
, size_t size
, int flags
)
2148 struct timespec ts1
,ts2
;
2151 clock_gettime_mono(&ts1
);
2152 result
= SMB_VFS_NEXT_FSETXATTR(handle
, fsp
, name
, value
, size
, flags
);
2153 clock_gettime_mono(&ts2
);
2154 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2156 if (timediff
> audit_timeout
) {
2157 smb_time_audit_log("fsetxattr", timediff
);
2163 static int smb_time_audit_aio_read(struct vfs_handle_struct
*handle
,
2164 struct files_struct
*fsp
,
2165 SMB_STRUCT_AIOCB
*aiocb
)
2168 struct timespec ts1
,ts2
;
2171 clock_gettime_mono(&ts1
);
2172 result
= SMB_VFS_NEXT_AIO_READ(handle
, fsp
, aiocb
);
2173 clock_gettime_mono(&ts2
);
2174 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2176 if (timediff
> audit_timeout
) {
2177 smb_time_audit_log("aio_read", timediff
);
2183 static int smb_time_audit_aio_write(struct vfs_handle_struct
*handle
,
2184 struct files_struct
*fsp
,
2185 SMB_STRUCT_AIOCB
*aiocb
)
2188 struct timespec ts1
,ts2
;
2191 clock_gettime_mono(&ts1
);
2192 result
= SMB_VFS_NEXT_AIO_WRITE(handle
, fsp
, aiocb
);
2193 clock_gettime_mono(&ts2
);
2194 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2196 if (timediff
> audit_timeout
) {
2197 smb_time_audit_log("aio_write", timediff
);
2203 static ssize_t
smb_time_audit_aio_return(struct vfs_handle_struct
*handle
,
2204 struct files_struct
*fsp
,
2205 SMB_STRUCT_AIOCB
*aiocb
)
2208 struct timespec ts1
,ts2
;
2211 clock_gettime_mono(&ts1
);
2212 result
= SMB_VFS_NEXT_AIO_RETURN(handle
, fsp
, aiocb
);
2213 clock_gettime_mono(&ts2
);
2214 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2216 if (timediff
> audit_timeout
) {
2217 smb_time_audit_log("aio_return", timediff
);
2223 static int smb_time_audit_aio_cancel(struct vfs_handle_struct
*handle
,
2224 struct files_struct
*fsp
,
2225 SMB_STRUCT_AIOCB
*aiocb
)
2228 struct timespec ts1
,ts2
;
2231 clock_gettime_mono(&ts1
);
2232 result
= SMB_VFS_NEXT_AIO_CANCEL(handle
, fsp
, aiocb
);
2233 clock_gettime_mono(&ts2
);
2234 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2236 if (timediff
> audit_timeout
) {
2237 smb_time_audit_log("aio_cancel", timediff
);
2243 static int smb_time_audit_aio_error(struct vfs_handle_struct
*handle
,
2244 struct files_struct
*fsp
,
2245 SMB_STRUCT_AIOCB
*aiocb
)
2248 struct timespec ts1
,ts2
;
2251 clock_gettime_mono(&ts1
);
2252 result
= SMB_VFS_NEXT_AIO_ERROR(handle
, fsp
, aiocb
);
2253 clock_gettime_mono(&ts2
);
2254 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2256 if (timediff
> audit_timeout
) {
2257 smb_time_audit_log("aio_error", timediff
);
2263 static int smb_time_audit_aio_fsync(struct vfs_handle_struct
*handle
,
2264 struct files_struct
*fsp
, int op
,
2265 SMB_STRUCT_AIOCB
*aiocb
)
2268 struct timespec ts1
,ts2
;
2271 clock_gettime_mono(&ts1
);
2272 result
= SMB_VFS_NEXT_AIO_FSYNC(handle
, fsp
, op
, aiocb
);
2273 clock_gettime_mono(&ts2
);
2274 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2276 if (timediff
> audit_timeout
) {
2277 smb_time_audit_log("aio_fsync", timediff
);
2283 static int smb_time_audit_aio_suspend(struct vfs_handle_struct
*handle
,
2284 struct files_struct
*fsp
,
2285 const SMB_STRUCT_AIOCB
* const aiocb
[],
2286 int n
, const struct timespec
*ts
)
2289 struct timespec ts1
,ts2
;
2292 clock_gettime_mono(&ts1
);
2293 result
= SMB_VFS_NEXT_AIO_SUSPEND(handle
, fsp
, aiocb
, n
, ts
);
2294 clock_gettime_mono(&ts2
);
2295 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2297 if (timediff
> audit_timeout
) {
2298 smb_time_audit_log("aio_suspend", timediff
);
2304 static bool smb_time_audit_aio_force(struct vfs_handle_struct
*handle
,
2305 struct files_struct
*fsp
)
2308 struct timespec ts1
,ts2
;
2311 clock_gettime_mono(&ts1
);
2312 result
= SMB_VFS_NEXT_AIO_FORCE(handle
, fsp
);
2313 clock_gettime_mono(&ts2
);
2314 timediff
= nsec_time_diff(&ts2
,&ts1
)*1.0e-9;
2316 if (timediff
> audit_timeout
) {
2317 smb_time_audit_log("aio_force", timediff
);
2325 /* VFS operations */
2327 static struct vfs_fn_pointers vfs_time_audit_fns
= {
2328 .connect_fn
= smb_time_audit_connect
,
2329 .disconnect_fn
= smb_time_audit_disconnect
,
2330 .disk_free_fn
= smb_time_audit_disk_free
,
2331 .get_quota_fn
= smb_time_audit_get_quota
,
2332 .set_quota_fn
= smb_time_audit_set_quota
,
2333 .get_shadow_copy_data_fn
= smb_time_audit_get_shadow_copy_data
,
2334 .statvfs_fn
= smb_time_audit_statvfs
,
2335 .fs_capabilities_fn
= smb_time_audit_fs_capabilities
,
2336 .opendir_fn
= smb_time_audit_opendir
,
2337 .fdopendir_fn
= smb_time_audit_fdopendir
,
2338 .readdir_fn
= smb_time_audit_readdir
,
2339 .seekdir_fn
= smb_time_audit_seekdir
,
2340 .telldir_fn
= smb_time_audit_telldir
,
2341 .rewind_dir_fn
= smb_time_audit_rewinddir
,
2342 .mkdir_fn
= smb_time_audit_mkdir
,
2343 .rmdir_fn
= smb_time_audit_rmdir
,
2344 .closedir_fn
= smb_time_audit_closedir
,
2345 .init_search_op_fn
= smb_time_audit_init_search_op
,
2346 .open_fn
= smb_time_audit_open
,
2347 .create_file_fn
= smb_time_audit_create_file
,
2348 .close_fn
= smb_time_audit_close
,
2349 .read_fn
= smb_time_audit_read
,
2350 .pread_fn
= smb_time_audit_pread
,
2351 .pread_send_fn
= smb_time_audit_pread_send
,
2352 .pread_recv_fn
= smb_time_audit_pread_recv
,
2353 .write_fn
= smb_time_audit_write
,
2354 .pwrite_fn
= smb_time_audit_pwrite
,
2355 .lseek_fn
= smb_time_audit_lseek
,
2356 .sendfile_fn
= smb_time_audit_sendfile
,
2357 .recvfile_fn
= smb_time_audit_recvfile
,
2358 .rename_fn
= smb_time_audit_rename
,
2359 .fsync_fn
= smb_time_audit_fsync
,
2360 .stat_fn
= smb_time_audit_stat
,
2361 .fstat_fn
= smb_time_audit_fstat
,
2362 .lstat_fn
= smb_time_audit_lstat
,
2363 .get_alloc_size_fn
= smb_time_audit_get_alloc_size
,
2364 .unlink_fn
= smb_time_audit_unlink
,
2365 .chmod_fn
= smb_time_audit_chmod
,
2366 .fchmod_fn
= smb_time_audit_fchmod
,
2367 .chown_fn
= smb_time_audit_chown
,
2368 .fchown_fn
= smb_time_audit_fchown
,
2369 .lchown_fn
= smb_time_audit_lchown
,
2370 .chdir_fn
= smb_time_audit_chdir
,
2371 .getwd_fn
= smb_time_audit_getwd
,
2372 .ntimes_fn
= smb_time_audit_ntimes
,
2373 .ftruncate_fn
= smb_time_audit_ftruncate
,
2374 .fallocate_fn
= smb_time_audit_fallocate
,
2375 .lock_fn
= smb_time_audit_lock
,
2376 .kernel_flock_fn
= smb_time_audit_kernel_flock
,
2377 .linux_setlease_fn
= smb_time_audit_linux_setlease
,
2378 .getlock_fn
= smb_time_audit_getlock
,
2379 .symlink_fn
= smb_time_audit_symlink
,
2380 .readlink_fn
= smb_time_audit_readlink
,
2381 .link_fn
= smb_time_audit_link
,
2382 .mknod_fn
= smb_time_audit_mknod
,
2383 .realpath_fn
= smb_time_audit_realpath
,
2384 .notify_watch_fn
= smb_time_audit_notify_watch
,
2385 .chflags_fn
= smb_time_audit_chflags
,
2386 .file_id_create_fn
= smb_time_audit_file_id_create
,
2387 .streaminfo_fn
= smb_time_audit_streaminfo
,
2388 .get_real_filename_fn
= smb_time_audit_get_real_filename
,
2389 .connectpath_fn
= smb_time_audit_connectpath
,
2390 .brl_lock_windows_fn
= smb_time_audit_brl_lock_windows
,
2391 .brl_unlock_windows_fn
= smb_time_audit_brl_unlock_windows
,
2392 .brl_cancel_windows_fn
= smb_time_audit_brl_cancel_windows
,
2393 .strict_lock_fn
= smb_time_audit_strict_lock
,
2394 .strict_unlock_fn
= smb_time_audit_strict_unlock
,
2395 .translate_name_fn
= smb_time_audit_translate_name
,
2396 .fget_nt_acl_fn
= smb_time_audit_fget_nt_acl
,
2397 .get_nt_acl_fn
= smb_time_audit_get_nt_acl
,
2398 .fset_nt_acl_fn
= smb_time_audit_fset_nt_acl
,
2399 .chmod_acl_fn
= smb_time_audit_chmod_acl
,
2400 .fchmod_acl_fn
= smb_time_audit_fchmod_acl
,
2401 .sys_acl_get_entry_fn
= smb_time_audit_sys_acl_get_entry
,
2402 .sys_acl_get_tag_type_fn
= smb_time_audit_sys_acl_get_tag_type
,
2403 .sys_acl_get_permset_fn
= smb_time_audit_sys_acl_get_permset
,
2404 .sys_acl_get_qualifier_fn
= smb_time_audit_sys_acl_get_qualifier
,
2405 .sys_acl_get_file_fn
= smb_time_audit_sys_acl_get_file
,
2406 .sys_acl_get_fd_fn
= smb_time_audit_sys_acl_get_fd
,
2407 .sys_acl_clear_perms_fn
= smb_time_audit_sys_acl_clear_perms
,
2408 .sys_acl_add_perm_fn
= smb_time_audit_sys_acl_add_perm
,
2409 .sys_acl_to_text_fn
= smb_time_audit_sys_acl_to_text
,
2410 .sys_acl_init_fn
= smb_time_audit_sys_acl_init
,
2411 .sys_acl_create_entry_fn
= smb_time_audit_sys_acl_create_entry
,
2412 .sys_acl_set_tag_type_fn
= smb_time_audit_sys_acl_set_tag_type
,
2413 .sys_acl_set_qualifier_fn
= smb_time_audit_sys_acl_set_qualifier
,
2414 .sys_acl_set_permset_fn
= smb_time_audit_sys_acl_set_permset
,
2415 .sys_acl_valid_fn
= smb_time_audit_sys_acl_valid
,
2416 .sys_acl_set_file_fn
= smb_time_audit_sys_acl_set_file
,
2417 .sys_acl_set_fd_fn
= smb_time_audit_sys_acl_set_fd
,
2418 .sys_acl_delete_def_file_fn
= smb_time_audit_sys_acl_delete_def_file
,
2419 .sys_acl_get_perm_fn
= smb_time_audit_sys_acl_get_perm
,
2420 .sys_acl_free_text_fn
= smb_time_audit_sys_acl_free_text
,
2421 .sys_acl_free_acl_fn
= smb_time_audit_sys_acl_free_acl
,
2422 .sys_acl_free_qualifier_fn
= smb_time_audit_sys_acl_free_qualifier
,
2423 .getxattr_fn
= smb_time_audit_getxattr
,
2424 .fgetxattr_fn
= smb_time_audit_fgetxattr
,
2425 .listxattr_fn
= smb_time_audit_listxattr
,
2426 .flistxattr_fn
= smb_time_audit_flistxattr
,
2427 .removexattr_fn
= smb_time_audit_removexattr
,
2428 .fremovexattr_fn
= smb_time_audit_fremovexattr
,
2429 .setxattr_fn
= smb_time_audit_setxattr
,
2430 .fsetxattr_fn
= smb_time_audit_fsetxattr
,
2431 .aio_read_fn
= smb_time_audit_aio_read
,
2432 .aio_write_fn
= smb_time_audit_aio_write
,
2433 .aio_return_fn
= smb_time_audit_aio_return
,
2434 .aio_cancel_fn
= smb_time_audit_aio_cancel
,
2435 .aio_error_fn
= smb_time_audit_aio_error
,
2436 .aio_fsync_fn
= smb_time_audit_aio_fsync
,
2437 .aio_suspend_fn
= smb_time_audit_aio_suspend
,
2438 .aio_force_fn
= smb_time_audit_aio_force
,
2442 NTSTATUS
vfs_time_audit_init(void);
2443 NTSTATUS
vfs_time_audit_init(void)
2445 audit_timeout
= (double)lp_parm_int(-1, "time_audit", "timeout",
2447 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION
, "time_audit",
2448 &vfs_time_audit_fns
);