[PATCH] Missing share path in tree connect

Ralph Böhme rb at sernet.de
Fri Jul 10 13:03:21 UTC 2015


Hi

two small patches that aim to reduce log flooding in case the
directory for a share is missing.

Please review and push if ok. Thanks!

-Ralph

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de,mailto:kontakt@sernet.de
-------------- next part --------------
From 54fa24b9e18d906a65b53bb138d4b3edfc3a6ea3 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Thu, 25 Jun 2015 18:43:50 +0200
Subject: [PATCH 1/2] vfs_shadow_copy2: change log level from 0 to 1 and log
 share path

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/modules/vfs_shadow_copy2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 439df5d..f980b91 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -1876,8 +1876,9 @@ static int shadow_copy2_connect(struct vfs_handle_struct *handle,
 		config->mount_point = shadow_copy2_find_mount_point(config,
 								    handle);
 		if (config->mount_point == NULL) {
-			DEBUG(0, (__location__ ": shadow_copy2_find_mount_point"
-				  " failed: %s\n", strerror(errno)));
+			DEBUG(1, (__location__ ": shadow_copy2_find_mount_point"
+                      " of the share root '%s' failed: %s\n",
+                      handle->conn->connectpath, strerror(errno)));
 			return -1;
 		}
 	}
-- 
1.9.1


From b823615ce6c4386c9466d6c448025e05ac7153df Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Thu, 25 Jun 2015 18:44:44 +0200
Subject: [PATCH 2/2] s3:smbd: change a loglevel from 0 to 1 when
 SMB_VFS_CONNECT fails

Logging at level 0 may result in log flooding. Additionally log the
share name that failed in SMB_VFS_CONNECT.

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/smbd/service.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index d11987e..3b9507b 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -669,7 +669,9 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
 
 	if (SMB_VFS_CONNECT(conn, lp_servicename(talloc_tos(), snum),
 			    conn->session_info->unix_info->unix_name) < 0) {
-		DEBUG(0,("make_connection: VFS make connection failed!\n"));
+		DEBUG(1,("SMB_VFS_CONNECT for service '%s' at '%s' failed: %s\n",
+			 lp_servicename(talloc_tos(), snum), conn->connectpath,
+			 strerror(errno)));
 		status = NT_STATUS_UNSUCCESSFUL;
 		goto err_root_exit;
 	}
-- 
1.9.1



More information about the samba-technical mailing list