From dcb6a24ed0dc54b65fb16938ddb714d96300905d Mon Sep 17 00:00:00 2001 From: Pierre Yager Date: Mon, 4 Jan 2021 14:32:55 +0100 Subject: [PATCH 1/2] Cleanup socket FD after pair is established. Fix #4086 Avoid filling Temp directory with temporary files. --- src/ip.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/ip.cpp b/src/ip.cpp index 7bc100e1..34ff647d 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -53,6 +53,9 @@ #endif #include + +#define rmdir _rmdir +#define unlink _unlink #endif #if defined ZMQ_HAVE_OPENVMS || defined ZMQ_HAVE_VXWORKS @@ -619,6 +622,16 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_) rc = closesocket (listener); wsa_assert (rc == 0); + // Cleanup temporary socket file descriptor + if (!filename.empty ()) { + rc = ::unlink (filename.c_str ()); + if ((rc == 0) && !dirname.empty ()) { + rc = ::rmdir (dirname.c_str ()); + dirname.clear (); + } + filename.clear (); + } + return 0; error_closeclient: @@ -631,6 +644,17 @@ error_closelistener: saved_errno = errno; rc = closesocket (listener); wsa_assert (rc == 0); + + // Cleanup temporary socket file descriptor + if (!filename.empty ()) { + rc = ::unlink (filename.c_str ()); + if ((rc == 0) && !dirname.empty ()) { + rc = ::rmdir (dirname.c_str ()); + dirname.clear (); + } + filename.clear (); + } + errno = saved_errno; return -1; From e8f265d1362d2d40478904d169907f9caf4b8d61 Mon Sep 17 00:00:00 2001 From: Pierre Yager Date: Mon, 4 Jan 2021 15:27:15 +0100 Subject: [PATCH 2/2] Added RELICENSE statement --- RELICENSE/zedalaye.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 RELICENSE/zedalaye.md diff --git a/RELICENSE/zedalaye.md b/RELICENSE/zedalaye.md new file mode 100644 index 00000000..8fed57d9 --- /dev/null +++ b/RELICENSE/zedalaye.md @@ -0,0 +1,14 @@ +# Permission to Relicense under MPLv2 + +This is a statement by Pierre Yager +that grants permission to relicense its copyrights in the libzmq C++ +library (ZeroMQ) under the Mozilla Public License v2 (MPLv2). + +A portion of the commits made by the Github handle "zedalaye", with +commit author "Pierre Yager " or +"Pierre Yager