From 425ac2c361fc1712c09b52f2cab0988597bf9b7e Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Tue, 24 May 2011 17:19:52 +0200 Subject: s3:vfs properly terminate enums in audit modules without the proper terminations of the enums, invalid arguments for the audit modules will lead to a smbd crash as the loop in lp_enum() will attempt to access memory behind the array --- source3/modules/vfs_full_audit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/modules/vfs_full_audit.c') diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index a723a0ce2d..e4d9599e74 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -355,7 +355,8 @@ static int audit_syslog_facility(vfs_handle_struct *handle) { LOG_LOCAL4, "LOCAL4" }, { LOG_LOCAL5, "LOCAL5" }, { LOG_LOCAL6, "LOCAL6" }, - { LOG_LOCAL7, "LOCAL7" } + { LOG_LOCAL7, "LOCAL7" }, + { -1, NULL} }; int facility; @@ -375,7 +376,8 @@ static int audit_syslog_priority(vfs_handle_struct *handle) { LOG_WARNING, "WARNING" }, { LOG_NOTICE, "NOTICE" }, { LOG_INFO, "INFO" }, - { LOG_DEBUG, "DEBUG" } + { LOG_DEBUG, "DEBUG" }, + { -1, NULL} }; int priority; -- cgit From d10674326b34e2f71a3bb17171e66277bfd1a92b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 25 May 2011 12:28:39 -0700 Subject: Fix bug #8165 - Inverted WITH_SYSLOG condition in vfs_full_audit.c. Found by freeserif@yahoo.com. Autobuild-User: Jeremy Allison Autobuild-Date: Wed May 25 22:37:23 CEST 2011 on sn-devel-104 --- source3/modules/vfs_full_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/modules/vfs_full_audit.c') diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index e4d9599e74..cb03413a53 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -617,7 +617,7 @@ static int smb_full_audit_connect(vfs_handle_struct *handle, return -1; } -#ifndef WITH_SYSLOG +#ifdef WITH_SYSLOG openlog("smbd_audit", 0, audit_syslog_facility(handle)); #endif -- cgit From 0ec9a90c29b86435f32c1d47d89df85fa51742f2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 30 May 2011 12:06:31 +0200 Subject: s3: Remove SHADOW_COPY_DATA typedef --- source3/modules/vfs_full_audit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/modules/vfs_full_audit.c') diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index cb03413a53..3b9c20a16b 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -697,7 +697,8 @@ static int smb_full_audit_set_quota(struct vfs_handle_struct *handle, static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, struct files_struct *fsp, - SHADOW_COPY_DATA *shadow_copy_data, bool labels) + struct shadow_copy_data *shadow_copy_data, + bool labels) { int result; -- cgit From c7d2f6d35a95678c91faf0b5ac7f83bc5d1abfde Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 31 May 2011 16:36:06 -0700 Subject: Remove the char * argument from the SMB_VFS_GETWD() call. Now always returns malloc'ed memory. Autobuild-User: Jeremy Allison Autobuild-Date: Wed Jun 1 04:06:12 CEST 2011 on sn-devel-104 --- source3/modules/vfs_full_audit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/modules/vfs_full_audit.c') diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 3b9c20a16b..bf7dacdc1f 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -1208,14 +1208,14 @@ static int smb_full_audit_chdir(vfs_handle_struct *handle, return result; } -static char *smb_full_audit_getwd(vfs_handle_struct *handle, - char *path) +static char *smb_full_audit_getwd(vfs_handle_struct *handle) { char *result; - result = SMB_VFS_NEXT_GETWD(handle, path); + result = SMB_VFS_NEXT_GETWD(handle); - do_log(SMB_VFS_OP_GETWD, (result != NULL), handle, "%s", path); + do_log(SMB_VFS_OP_GETWD, (result != NULL), handle, "%s", + result == NULL? "" : result); return result; } -- cgit From ad0a07c531fadd1639c5298951cfaf5cfe0cb10e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:44:43 +1000 Subject: s3-talloc Change TALLOC_ZERO_P() to talloc_zero() Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc. --- source3/modules/vfs_full_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/modules/vfs_full_audit.c') diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index bf7dacdc1f..e8129f4143 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -611,7 +611,7 @@ static int smb_full_audit_connect(vfs_handle_struct *handle, return result; } - pd = TALLOC_ZERO_P(handle, struct vfs_full_audit_private_data); + pd = talloc_zero(handle, struct vfs_full_audit_private_data); if (!pd) { SMB_VFS_NEXT_DISCONNECT(handle); return -1; -- cgit