From: Christof Schmitt Date: Wed, 13 Dec 2017 18:34:23 +0000 (-0700) Subject: smbd: Fix coredump on failing chdir during logoff X-Git-Tag: samba-4.6.13~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ba61252745b097ab73b78534e227660d564ca11;p=thirdparty%2Fsamba.git smbd: Fix coredump on failing chdir during logoff server_exit does an internal tree disconnect which requires a chdir to the share directory. In case the file system encountered a problem and the chdir call returns an error, this triggers a SERVER_EXIT_ABNORMAL which in turn results in a panic and a coredump. As the log already indicates the problem (chdir returned an error), avoid the SERVER_EXIT_ABNORMAL in this case and not trigger a coredump. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13189 Signed-off-by: Christof Schmitt Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Sat Dec 16 01:56:06 CET 2017 on sn-devel-144 (cherry picked from commit 7fa91fc4791d076c609eaf119753e38dd3c50a1c) Autobuild-User(v4-6-test): Karolin Seeger Autobuild-Date(v4-6-test): Tue Jan 2 14:01:29 CET 2018 on sn-devel-144 --- diff --git a/selftest/knownfail b/selftest/knownfail index e259ccc3e85..6e1d0589922 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -308,4 +308,3 @@ ^samba.tests.dcerpc.dnsserver.samba.tests.dcerpc.dnsserver.DnsserverTests.test_rank_none.* ^samba.tests.dcerpc.dnsserver.samba.tests.dcerpc.dnsserver.DnsserverTests.test_security_descriptor.* ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\) -^samba3.blackbox.smbd_error.check_panic_2 diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c index bf50394f4bf..04a2932538f 100644 --- a/source3/smbd/server_exit.c +++ b/source3/smbd/server_exit.c @@ -149,8 +149,6 @@ static void exit_server_common(enum server_exit_reason how, DEBUG(0, ("exit_server_common: " "smb1srv_tcon_disconnect_all() failed (%s) - " "triggering cleanup\n", nt_errstr(status))); - how = SERVER_EXIT_ABNORMAL; - reason = "smb1srv_tcon_disconnect_all failed"; } status = smbXsrv_session_logoff_all(xconn); @@ -160,8 +158,6 @@ static void exit_server_common(enum server_exit_reason how, DEBUG(0, ("exit_server_common: " "smbXsrv_session_logoff_all() failed (%s) - " "triggering cleanup\n", nt_errstr(status))); - how = SERVER_EXIT_ABNORMAL; - reason = "smbXsrv_session_logoff_all failed"; } }