From: Volker Lendecke Date: Tue, 10 Jan 2017 12:30:54 +0000 (+0000) Subject: messaging: Fix dead but not cleaned-up-yet destination sockets X-Git-Tag: samba-4.4.10~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=930667c3b223341118a95c46443a8737e4337226;p=thirdparty%2Fsamba.git messaging: Fix dead but not cleaned-up-yet destination sockets Bug: https://bugzilla.samba.org/show_bug.cgi?id=12509 Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Tue Jan 10 17:40:58 CET 2017 on sn-devel-144 (cherry picked from commit e84e44ce923e5dc7529bb813e10a2890528a4ab0) Autobuild-User(v4-4-test): Stefan Metzmacher Autobuild-Date(v4-4-test): Sat Jan 14 13:55:25 CET 2017 on sn-devel-144 --- diff --git a/source3/lib/messages.c b/source3/lib/messages.c index ef8e83dd6e6..908c53cfd96 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -561,6 +561,17 @@ int messaging_send_iov_from(struct messaging_context *msg_ctx, ret = messaging_dgm_send(dst.pid, iov2, iovlen+1, fds, num_fds); unbecome_root(); + if (ret == ECONNREFUSED) { + /* + * Linux returns this when a socket exists in the file + * system without a listening process. This is not + * documented in susv4 or the linux manpages, but it's + * easily testable. For the higher levels this is the + * same as "destination does not exist" + */ + ret = ENOENT; + } + return ret; }