[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Tue Apr 5 06:58:04 UTC 2016
The branch, master has been updated
via ff6b49b nwrap: Fix the build on Solaris
via a4bb49b s3: vfs: time_audit. Add missing audit_file().
via 0bb6315 s3: vfs: time_audit: Add get/fget/set/fset dos_attributes functions.
via e2a3204 s3: vfs: time_audit. Add missing fsctl().
via 8a92450 s3: vfs: time_audit. Add missing get_dfs_referrals().
via 6ccd3ad s3: vfs: Sort vfs function entries in vfs_time_audit.
via 884ad41 s3: vfs: full_audit. Implement missing durable_XXX functions.
via 4489b4c s3: vfs: full_audit. Add audit_file_fn().
via de547ca s3: vfs: full_audit. Add missing fsctl_fn().
via 40a8a72 s3: vfs: full_audit. Add missing get_dfs_referrals_fn().
via 70174af s3: vfs: full_audit. Sort vfs fn list and add comments on missing entries.
from 0da76c9 lib:replace: Missing semicolon on function definition.
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit ff6b49beeb5df30f4e243a97d2e6218ec497e9ad
Author: Volker Lendecke <vl at samba.org>
Date: Mon Apr 4 13:43:02 2016 +0200
nwrap: Fix the build on Solaris
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11816
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Tue Apr 5 08:57:06 CEST 2016 on sn-devel-144
commit a4bb49b93a58013044dfff0b0035db2c4b709f24
Author: Jeremy Allison <jra at samba.org>
Date: Mon Apr 4 17:01:53 2016 -0700
s3: vfs: time_audit. Add missing audit_file().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 0bb63152dc708e96f50a0abd1bda02a1ae3985ac
Author: Jeremy Allison <jra at samba.org>
Date: Mon Apr 4 16:57:12 2016 -0700
s3: vfs: time_audit: Add get/fget/set/fset dos_attributes functions.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit e2a32043d50a63041c85a4cfcc7258b2b98d5d4a
Author: Jeremy Allison <jra at samba.org>
Date: Mon Apr 4 16:46:56 2016 -0700
s3: vfs: time_audit. Add missing fsctl().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 8a92450d53042fe407671729a2d852309dfcda00
Author: Jeremy Allison <jra at samba.org>
Date: Mon Apr 4 16:42:49 2016 -0700
s3: vfs: time_audit. Add missing get_dfs_referrals().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 6ccd3ade93815cf8b1395df8934f5dfc73b3d76d
Author: Jeremy Allison <jra at samba.org>
Date: Mon Apr 4 16:39:22 2016 -0700
s3: vfs: Sort vfs function entries in vfs_time_audit.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 884ad41f022ddf1c6a9b80f30d868044832bd9a4
Author: Jeremy Allison <jra at samba.org>
Date: Mon Apr 4 16:29:32 2016 -0700
s3: vfs: full_audit. Implement missing durable_XXX functions.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 4489b4cee448e5ed6816e6a0587e5194455d35ae
Author: Jeremy Allison <jra at samba.org>
Date: Mon Apr 4 16:27:05 2016 -0700
s3: vfs: full_audit. Add audit_file_fn().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit de547cad1e1e18de1d938a4604e20c5ed4f37e2b
Author: Jeremy Allison <jra at samba.org>
Date: Mon Apr 4 16:25:47 2016 -0700
s3: vfs: full_audit. Add missing fsctl_fn().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 40a8a72d8f13309f022b80add8b02158299f31a5
Author: Jeremy Allison <jra at samba.org>
Date: Mon Apr 4 16:24:10 2016 -0700
s3: vfs: full_audit. Add missing get_dfs_referrals_fn().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 70174af615ca54d59eda673f7dd3946503b4d9f1
Author: Jeremy Allison <jra at samba.org>
Date: Mon Apr 4 16:22:06 2016 -0700
s3: vfs: full_audit. Sort vfs fn list and add comments on missing entries.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
-----------------------------------------------------------------------
Summary of changes:
lib/nss_wrapper/wscript | 2 +-
source3/modules/vfs_full_audit.c | 183 +++++++++++++++++++++++++++++++----
source3/modules/vfs_time_audit.c | 201 +++++++++++++++++++++++++++++++++++++--
3 files changed, 361 insertions(+), 25 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/nss_wrapper/wscript b/lib/nss_wrapper/wscript
index 32bdbbd..d53accb 100644
--- a/lib/nss_wrapper/wscript
+++ b/lib/nss_wrapper/wscript
@@ -62,7 +62,7 @@ def configure(conf):
define='HAVE_SOLARIS_GETPWUID_R', headers='unistd.h pwd.h')
conf.CHECK_C_PROTOTYPE('getgrent_r',
'struct group *getgrent_r(struct group *src, char *buf, int buflen)',
- define='SOLARIS_GETGRENT_R', headers='unistd.h grp.h')
+ define='HAVE_SOLARIS_GETGRENT_R', headers='unistd.h grp.h')
conf.CHECK_C_PROTOTYPE('getgrnam_r',
'int getgrnam_r(const char *name, struct group *grp, char *buf, int buflen, struct group **pgrp)',
define='HAVE_SOLARIS_GETGRNAM_R', headers='unistd.h grp.h')
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 79c57e8..0ce44bf 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -97,9 +97,7 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_GET_SHADOW_COPY_DATA,
SMB_VFS_OP_STATVFS,
SMB_VFS_OP_FS_CAPABILITIES,
- SMB_VFS_OP_SNAP_CHECK_PATH,
- SMB_VFS_OP_SNAP_CREATE,
- SMB_VFS_OP_SNAP_DELETE,
+ SMB_VFS_OP_GET_DFS_REFERRALS,
/* Directory operations */
@@ -169,11 +167,14 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_STRICT_LOCK,
SMB_VFS_OP_STRICT_UNLOCK,
SMB_VFS_OP_TRANSLATE_NAME,
+ SMB_VFS_OP_FSCTL,
SMB_VFS_OP_COPY_CHUNK_SEND,
SMB_VFS_OP_COPY_CHUNK_RECV,
SMB_VFS_OP_GET_COMPRESSION,
SMB_VFS_OP_SET_COMPRESSION,
- SMB_VFS_OP_READDIR_ATTR,
+ SMB_VFS_OP_SNAP_CHECK_PATH,
+ SMB_VFS_OP_SNAP_CREATE,
+ SMB_VFS_OP_SNAP_DELETE,
/* DOS attribute operations. */
SMB_VFS_OP_GET_DOS_ATTRIBUTES,
@@ -186,6 +187,7 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_FGET_NT_ACL,
SMB_VFS_OP_GET_NT_ACL,
SMB_VFS_OP_FSET_NT_ACL,
+ SMB_VFS_OP_AUDIT_FILE,
/* POSIX ACL operations. */
@@ -217,6 +219,13 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_IS_OFFLINE,
SMB_VFS_OP_SET_OFFLINE,
+ /* Durable handle operations. */
+ SMB_VFS_OP_DURABLE_COOKIE,
+ SMB_VFS_OP_DURABLE_DISCONNECT,
+ SMB_VFS_OP_DURABLE_RECONNECT,
+
+ SMB_VFS_OP_READDIR_ATTR,
+
/* This should always be last enum value */
SMB_VFS_OP_LAST
@@ -236,9 +245,7 @@ static struct {
{ SMB_VFS_OP_GET_SHADOW_COPY_DATA, "get_shadow_copy_data" },
{ SMB_VFS_OP_STATVFS, "statvfs" },
{ SMB_VFS_OP_FS_CAPABILITIES, "fs_capabilities" },
- { SMB_VFS_OP_SNAP_CHECK_PATH, "snap_check_path" },
- { SMB_VFS_OP_SNAP_CREATE, "snap_create" },
- { SMB_VFS_OP_SNAP_DELETE, "snap_delete" },
+ { SMB_VFS_OP_GET_DFS_REFERRALS, "get_dfs_referrals" },
{ SMB_VFS_OP_OPENDIR, "opendir" },
{ SMB_VFS_OP_FDOPENDIR, "fdopendir" },
{ SMB_VFS_OP_READDIR, "readdir" },
@@ -302,11 +309,14 @@ static struct {
{ SMB_VFS_OP_STRICT_LOCK, "strict_lock" },
{ SMB_VFS_OP_STRICT_UNLOCK, "strict_unlock" },
{ SMB_VFS_OP_TRANSLATE_NAME, "translate_name" },
+ { SMB_VFS_OP_FSCTL, "fsctl" },
{ SMB_VFS_OP_COPY_CHUNK_SEND, "copy_chunk_send" },
{ SMB_VFS_OP_COPY_CHUNK_RECV, "copy_chunk_recv" },
{ SMB_VFS_OP_GET_COMPRESSION, "get_compression" },
{ SMB_VFS_OP_SET_COMPRESSION, "set_compression" },
- { SMB_VFS_OP_READDIR_ATTR, "readdir_attr" },
+ { SMB_VFS_OP_SNAP_CHECK_PATH, "snap_check_path" },
+ { SMB_VFS_OP_SNAP_CREATE, "snap_create" },
+ { SMB_VFS_OP_SNAP_DELETE, "snap_delete" },
{ SMB_VFS_OP_GET_DOS_ATTRIBUTES, "get_dos_attributes" },
{ SMB_VFS_OP_FGET_DOS_ATTRIBUTES, "fget_dos_attributes" },
{ SMB_VFS_OP_SET_DOS_ATTRIBUTES, "set_dos_attributes" },
@@ -314,6 +324,7 @@ static struct {
{ SMB_VFS_OP_FGET_NT_ACL, "fget_nt_acl" },
{ SMB_VFS_OP_GET_NT_ACL, "get_nt_acl" },
{ SMB_VFS_OP_FSET_NT_ACL, "fset_nt_acl" },
+ { SMB_VFS_OP_AUDIT_FILE, "audit_file" },
{ SMB_VFS_OP_CHMOD_ACL, "chmod_acl" },
{ SMB_VFS_OP_FCHMOD_ACL, "fchmod_acl" },
{ SMB_VFS_OP_SYS_ACL_GET_FILE, "sys_acl_get_file" },
@@ -334,6 +345,10 @@ static struct {
{ SMB_VFS_OP_AIO_FORCE, "aio_force" },
{ SMB_VFS_OP_IS_OFFLINE, "is_offline" },
{ SMB_VFS_OP_SET_OFFLINE, "set_offline" },
+ { SMB_VFS_OP_DURABLE_COOKIE, "durable_cookie" },
+ { SMB_VFS_OP_DURABLE_DISCONNECT, "durable_disconnect" },
+ { SMB_VFS_OP_DURABLE_RECONNECT, "durable_reconnect" },
+ { SMB_VFS_OP_READDIR_ATTR, "readdir_attr" },
{ SMB_VFS_OP_LAST, NULL }
};
@@ -739,6 +754,20 @@ static uint32_t smb_full_audit_fs_capabilities(struct vfs_handle_struct *handle,
return result;
}
+static NTSTATUS smb_full_audit_get_dfs_referrals(
+ struct vfs_handle_struct *handle,
+ struct dfs_GetDFSReferral *r)
+{
+ NTSTATUS status;
+
+ status = SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r);
+
+ do_log(SMB_VFS_OP_GET_DFS_REFERRALS, NT_STATUS_IS_OK(status),
+ handle, "");
+
+ return status;
+}
+
static NTSTATUS smb_full_audit_snap_check_path(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
const char *service_path,
@@ -1824,6 +1853,35 @@ static NTSTATUS smb_full_audit_translate_name(struct vfs_handle_struct *handle,
return result;
}
+static NTSTATUS smb_full_audit_fsctl(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ TALLOC_CTX *ctx,
+ uint32_t function,
+ uint16_t req_flags,
+ const uint8_t *_in_data,
+ uint32_t in_len,
+ uint8_t **_out_data,
+ uint32_t max_out_len,
+ uint32_t *out_len)
+{
+ NTSTATUS result;
+
+ result = SMB_VFS_NEXT_FSCTL(handle,
+ fsp,
+ ctx,
+ function,
+ req_flags,
+ _in_data,
+ in_len,
+ _out_data,
+ max_out_len,
+ out_len);
+
+ do_log(SMB_VFS_OP_FSCTL, NT_STATUS_IS_OK(result), handle, "");
+
+ return result;
+}
+
static struct tevent_req *smb_full_audit_copy_chunk_send(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
@@ -2044,6 +2102,26 @@ static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_stru
return result;
}
+static NTSTATUS smb_full_audit_audit_file(struct vfs_handle_struct *handle,
+ struct smb_filename *file,
+ struct security_acl *sacl,
+ uint32_t access_requested,
+ uint32_t access_denied)
+{
+ NTSTATUS result;
+
+ result = SMB_VFS_NEXT_AUDIT_FILE(handle,
+ file,
+ sacl,
+ access_requested,
+ access_denied);
+
+ do_log(SMB_VFS_OP_AUDIT_FILE, NT_STATUS_IS_OK(result), handle,
+ "%s", smb_fname_str_do_log(file));
+
+ return result;
+}
+
static int smb_full_audit_chmod_acl(vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
mode_t mode)
@@ -2321,6 +2399,72 @@ static int smb_full_audit_set_offline(struct vfs_handle_struct *handle,
return result;
}
+static NTSTATUS smb_full_audit_durable_cookie(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ TALLOC_CTX *mem_ctx,
+ DATA_BLOB *cookie)
+{
+ NTSTATUS result;
+
+ result = SMB_VFS_NEXT_DURABLE_COOKIE(handle,
+ fsp,
+ mem_ctx,
+ cookie);
+
+ do_log(SMB_VFS_OP_DURABLE_COOKIE, NT_STATUS_IS_OK(result), handle,
+ "%s", fsp_str_do_log(fsp));
+
+ return result;
+}
+
+static NTSTATUS smb_full_audit_durable_disconnect(
+ struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ const DATA_BLOB old_cookie,
+ TALLOC_CTX *mem_ctx,
+ DATA_BLOB *new_cookie)
+{
+ NTSTATUS result;
+
+ result = SMB_VFS_NEXT_DURABLE_DISCONNECT(handle,
+ fsp,
+ old_cookie,
+ mem_ctx,
+ new_cookie);
+
+ do_log(SMB_VFS_OP_DURABLE_DISCONNECT, NT_STATUS_IS_OK(result), handle,
+ "%s", fsp_str_do_log(fsp));
+
+ return result;
+}
+
+static NTSTATUS smb_full_audit_durable_reconnect(
+ struct vfs_handle_struct *handle,
+ struct smb_request *smb1req,
+ struct smbXsrv_open *op,
+ const DATA_BLOB old_cookie,
+ TALLOC_CTX *mem_ctx,
+ struct files_struct **fsp,
+ DATA_BLOB *new_cookie)
+{
+ NTSTATUS result;
+
+ result = SMB_VFS_NEXT_DURABLE_RECONNECT(handle,
+ smb1req,
+ op,
+ old_cookie,
+ mem_ctx,
+ fsp,
+ new_cookie);
+
+ do_log(SMB_VFS_OP_DURABLE_RECONNECT,
+ NT_STATUS_IS_OK(result),
+ handle,
+ "");
+
+ return result;
+}
+
static struct vfs_fn_pointers vfs_full_audit_fns = {
/* Disk operations */
@@ -2333,9 +2477,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.get_shadow_copy_data_fn = smb_full_audit_get_shadow_copy_data,
.statvfs_fn = smb_full_audit_statvfs,
.fs_capabilities_fn = smb_full_audit_fs_capabilities,
- .snap_check_path_fn = smb_full_audit_snap_check_path,
- .snap_create_fn = smb_full_audit_snap_create,
- .snap_delete_fn = smb_full_audit_snap_delete,
+ .get_dfs_referrals_fn = smb_full_audit_get_dfs_referrals,
.opendir_fn = smb_full_audit_opendir,
.fdopendir_fn = smb_full_audit_fdopendir,
.readdir_fn = smb_full_audit_readdir,
@@ -2390,6 +2532,13 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.realpath_fn = smb_full_audit_realpath,
.chflags_fn = smb_full_audit_chflags,
.file_id_create_fn = smb_full_audit_file_id_create,
+ .copy_chunk_send_fn = smb_full_audit_copy_chunk_send,
+ .copy_chunk_recv_fn = smb_full_audit_copy_chunk_recv,
+ .get_compression_fn = smb_full_audit_get_compression,
+ .set_compression_fn = smb_full_audit_set_compression,
+ .snap_check_path_fn = smb_full_audit_snap_check_path,
+ .snap_create_fn = smb_full_audit_snap_create,
+ .snap_delete_fn = smb_full_audit_snap_delete,
.streaminfo_fn = smb_full_audit_streaminfo,
.get_real_filename_fn = smb_full_audit_get_real_filename,
.connectpath_fn = smb_full_audit_connectpath,
@@ -2399,11 +2548,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.strict_lock_fn = smb_full_audit_strict_lock,
.strict_unlock_fn = smb_full_audit_strict_unlock,
.translate_name_fn = smb_full_audit_translate_name,
- .copy_chunk_send_fn = smb_full_audit_copy_chunk_send,
- .copy_chunk_recv_fn = smb_full_audit_copy_chunk_recv,
- .get_compression_fn = smb_full_audit_get_compression,
- .set_compression_fn = smb_full_audit_set_compression,
- .readdir_attr_fn = smb_full_audit_readdir_attr,
+ .fsctl_fn = smb_full_audit_fsctl,
.get_dos_attributes_fn = smb_full_audit_get_dos_attributes,
.fget_dos_attributes_fn = smb_full_audit_fget_dos_attributes,
.set_dos_attributes_fn = smb_full_audit_set_dos_attributes,
@@ -2411,6 +2556,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.fget_nt_acl_fn = smb_full_audit_fget_nt_acl,
.get_nt_acl_fn = smb_full_audit_get_nt_acl,
.fset_nt_acl_fn = smb_full_audit_fset_nt_acl,
+ .audit_file_fn = smb_full_audit_audit_file,
.chmod_acl_fn = smb_full_audit_chmod_acl,
.fchmod_acl_fn = smb_full_audit_fchmod_acl,
.sys_acl_get_file_fn = smb_full_audit_sys_acl_get_file,
@@ -2431,6 +2577,11 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.aio_force_fn = smb_full_audit_aio_force,
.is_offline_fn = smb_full_audit_is_offline,
.set_offline_fn = smb_full_audit_set_offline,
+ .durable_cookie_fn = smb_full_audit_durable_cookie,
+ .durable_disconnect_fn = smb_full_audit_durable_disconnect,
+ .durable_reconnect_fn = smb_full_audit_durable_reconnect,
+ .readdir_attr_fn = smb_full_audit_readdir_attr
+
};
static_decl_vfs;
diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c
index 3bdc98b..8d88d17 100644
--- a/source3/modules/vfs_time_audit.c
+++ b/source3/modules/vfs_time_audit.c
@@ -277,6 +277,26 @@ static uint32_t smb_time_audit_fs_capabilities(struct vfs_handle_struct *handle,
return result;
}
+static NTSTATUS smb_time_audit_get_dfs_referrals(
+ struct vfs_handle_struct *handle,
+ struct dfs_GetDFSReferral *r)
+{
+ NTSTATUS result;
+ struct timespec ts1,ts2;
+ double timediff;
+
+ clock_gettime_mono(&ts1);
+ result = SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r);
+ clock_gettime_mono(&ts2);
+ timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+ if (timediff > audit_timeout) {
+ smb_time_audit_log("get_dfs_referrals(", timediff);
+ }
+
+ return result;
+}
+
static NTSTATUS smb_time_audit_snap_check_path(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
const char *service_path,
@@ -1724,6 +1744,134 @@ static NTSTATUS smb_time_audit_translate_name(struct vfs_handle_struct *handle,
return result;
}
+static NTSTATUS smb_time_audit_fsctl(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ TALLOC_CTX *ctx,
+ uint32_t function,
+ uint16_t req_flags,
+ const uint8_t *_in_data,
+ uint32_t in_len,
+ uint8_t **_out_data,
+ uint32_t max_out_len,
+ uint32_t *out_len)
+{
+ NTSTATUS result;
+ struct timespec ts1,ts2;
+ double timediff;
+
+ clock_gettime_mono(&ts1);
+ result = SMB_VFS_NEXT_FSCTL(handle,
+ fsp,
+ ctx,
+ function,
+ req_flags,
+ _in_data,
+ in_len,
+ _out_data,
+ max_out_len,
+ out_len);
+ clock_gettime_mono(&ts2);
+ timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+ if (timediff > audit_timeout) {
+ smb_time_audit_log_fsp("fsctl", timediff, fsp);
+ }
+
+ return result;
+}
+
+static NTSTATUS smb_time_get_dos_attributes(struct vfs_handle_struct *handle,
+ struct smb_filename *smb_fname,
+ uint32_t *dosmode)
+{
+ NTSTATUS result;
+ struct timespec ts1,ts2;
+ double timediff;
+
+ clock_gettime_mono(&ts1);
+ result = SMB_VFS_NEXT_GET_DOS_ATTRIBUTES(handle,
+ smb_fname,
+ dosmode);
+ clock_gettime_mono(&ts2);
+ timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+ if (timediff > audit_timeout) {
+ smb_time_audit_log_fname("get_dos_attributes",
+ timediff,
+ smb_fname->base_name);
+ }
+
+ return result;
+}
+
+static NTSTATUS smb_time_fget_dos_attributes(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ uint32_t *dosmode)
+{
+ NTSTATUS result;
+ struct timespec ts1,ts2;
+ double timediff;
+
+ clock_gettime_mono(&ts1);
+ result = SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle,
+ fsp,
+ dosmode);
+ clock_gettime_mono(&ts2);
+ timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+ if (timediff > audit_timeout) {
+ smb_time_audit_log_fsp("fget_dos_attributes", timediff, fsp);
+ }
+
+ return result;
+}
+
+static NTSTATUS smb_time_set_dos_attributes(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ uint32_t dosmode)
+{
+ NTSTATUS result;
+ struct timespec ts1,ts2;
+ double timediff;
+
+ clock_gettime_mono(&ts1);
+ result = SMB_VFS_NEXT_SET_DOS_ATTRIBUTES(handle,
+ smb_fname,
+ dosmode);
+ clock_gettime_mono(&ts2);
+ timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+ if (timediff > audit_timeout) {
+ smb_time_audit_log_fname("set_dos_attributes",
+ timediff,
+ smb_fname->base_name);
+ }
+
+ return result;
+}
+
+static NTSTATUS smb_time_fset_dos_attributes(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ uint32_t dosmode)
+{
+ NTSTATUS result;
+ struct timespec ts1,ts2;
+ double timediff;
+
+ clock_gettime_mono(&ts1);
+ result = SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle,
+ fsp,
+ dosmode);
+ clock_gettime_mono(&ts2);
+ timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+ if (timediff > audit_timeout) {
+ smb_time_audit_log_fsp("fset_dos_attributes", timediff, fsp);
+ }
+
+ return result;
+}
+
struct time_audit_cc_state {
struct timespec ts_send;
struct vfs_handle_struct *handle;
@@ -1948,6 +2096,36 @@ static NTSTATUS smb_time_audit_fset_nt_acl(vfs_handle_struct *handle,
return result;
}
+static NTSTATUS smb_time_audit_audit_file(struct vfs_handle_struct *handle,
+ struct smb_filename *smb_fname,
+ struct security_acl *sacl,
--
Samba Shared Repository
More information about the samba-cvs
mailing list