[PATCH] DON'T PANIC!

Ralph Böhme slow at samba.org
Mon Mar 18 17:06:47 UTC 2019


On Mon, Mar 18, 2019 at 05:12:32PM +0100, Ralph Böhme via samba-technical wrote:
>Please review&push if happy. Thanks!

sorry, wrong patch. This one includes an additional DBG_ERR statement so we see 
the offending path and error in case we hit this.

-slow

-- 
Ralph Boehme, Samba Team                https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
GPG-Fingerprint   FAE2C6088A24252051C559E4AA1E9B7126399E46
-------------- next part --------------
From 6e09359a36bcf7edc90f4d9efd2e3da84c858f62 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Thu, 31 Jan 2019 10:46:24 +0100
Subject: [PATCH] s3:smbd: don't panic in process_symlink_open() error code
 path

This was hit on a system with a FUSE filesystem that went dead.

DON'T PANIC! A simple exit_server_cleanly() should be enough. A crashing
Samba makes it look like there's a real problem in Samba where this is
clearly not the case here.

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

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index bab9286751f..b64c9f1bcce 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -563,7 +563,12 @@ static int process_symlink_open(struct connection_struct *conn,
 	if (oldwd_fname != NULL) {
 		int ret = vfs_ChDir(conn, oldwd_fname);
 		if (ret == -1) {
-			smb_panic("unable to get back to old directory\n");
+			DBG_ERR("unable to chdir back to conn [%s] dir [%s] "
+				"errno [%d]\n",
+				conn->connectpath,
+				smb_fname_str_dbg(oldwd_fname),
+				errno);
+			exit_server_cleanly("unable to chdir to old directory");
 		}
 		TALLOC_FREE(oldwd_fname);
 	}
-- 
2.17.2



More information about the samba-technical mailing list