From 8303bc49a45d5bab0cdbd4f2d793088f600f715f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 30 Nov 2009 15:53:04 -0800 Subject: Restructure the connect function code to always call down to NEXT-> before initializing. This allows us to do cleanup (by calling DISCONNECT) if initialization fails. Also fix vfs_acl_xattr which was failing to call the NEXT connect function. Jeremy. --- source3/modules/vfs_full_audit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 d9d12a1d28..19ac7adaed 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -606,12 +606,14 @@ static int smb_full_audit_connect(vfs_handle_struct *handle, const char *none[] = { NULL }; const char *all [] = { "all" }; - if (!handle) { - return -1; + result = SMB_VFS_NEXT_CONNECT(handle, svc, user); + if (result < 0) { + return result; } pd = SMB_MALLOC_P(struct vfs_full_audit_private_data); if (!pd) { + SMB_VFS_NEXT_DISCONNECT(handle); return -1; } ZERO_STRUCTP(pd); @@ -631,12 +633,10 @@ static int smb_full_audit_connect(vfs_handle_struct *handle, SMB_VFS_HANDLE_SET_DATA(handle, pd, free_private_data, struct vfs_full_audit_private_data, return -1); - result = SMB_VFS_NEXT_CONNECT(handle, svc, user); - do_log(SMB_VFS_OP_CONNECT, True, handle, "%s", svc); - return result; + return 0; } static void smb_full_audit_disconnect(vfs_handle_struct *handle) -- cgit