Mailing List Archive

[Bug 2656] proxy protocol support doesn't work in -bh (host_checking) mode
https://bugs.exim.org/show_bug.cgi?id=2656

Heiko Schlittermann <hs@schlittermann.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
Assignee|jgh146exb@wizmail.org |hs@schlittermann.de

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2656] proxy protocol support doesn't work in -bh (host_checking) mode [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2656

--- Comment #1 from Heiko Schlittermann <hs@schlittermann.de> ---
Replacing recv() with read() seems to be sufficient in my small test
environment. Timeout for read() needs to be implemented. I'm working on it.

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2656] proxy protocol support doesn't work in -bh (host_checking) mode [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2656

--- Comment #2 from Heiko Schlittermann <hs@schlittermann.de> ---
Proof of Concept: https://git.exim.org/users/heiko/exim.git, branch
hs/fix-proxy-bh
Tests need to be implemented

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2656] proxy protocol support doesn't work in -bh (host_checking) mode [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2656

Heiko Schlittermann <hs@schlittermann.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED

--- Comment #3 from Heiko Schlittermann <hs@schlittermann.de> ---
closed e248dbece

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2656] proxy protocol support doesn't work in -bh (host_checking) mode [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2656

Git Commit <git@exim.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |git@exim.org

--- Comment #4 from Git Commit <git@exim.org> ---
Git commit:
https://git.exim.org/exim.git/commitdiff/f5107e39b94bd7d304dbe3ec766b5eecd647fe00

commit f5107e39b94bd7d304dbe3ec766b5eecd647fe00
Author: Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
AuthorDate: Fri Oct 2 08:17:39 2020 +0200
Commit: Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
CommitDate: Sun Oct 4 11:23:35 2020 +0200

Replace recv() by read() (Bug 2656)
---
src/src/smtp_in.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index c0b6b2a..3941667 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -1128,7 +1128,7 @@ if (cr != NULL)

while (capacity > 0)
{
- do { ret = recv(fd, to, 1, 0); } while (ret == -1 && errno == EINTR);
+ do { ret = read(fd, to, 1); } while (ret == -1 && errno == EINTR);
if (ret == -1)
return -1;
have++;
@@ -1253,7 +1253,7 @@ do
don't do a PEEK into the data, actually slurp up enough to be
"safe". Can't take it all because TLS-on-connect clients follow
immediately with TLS handshake. */
- ret = recv(fd, &hdr, PROXY_INITIAL_READ, 0);
+ ret = read(fd, &hdr, PROXY_INITIAL_READ);
}
while (ret == -1 && errno == EINTR);

@@ -1269,7 +1269,7 @@ if ((ret == PROXY_INITIAL_READ) && (memcmp(&hdr.v2,
v2sig, sizeof(v2sig)) == 0))
/* First get the length fields. */
do
{
- retmore = recv(fd, (uschar*)&hdr + ret, PROXY_V2_HEADER_SIZE -
PROXY_INITIAL_READ, 0);
+ retmore = read(fd, (uschar*)&hdr + ret, PROXY_V2_HEADER_SIZE -
PROXY_INITIAL_READ);
} while (retmore == -1 && errno == EINTR);
if (retmore == -1)
goto proxyfail;
@@ -1306,7 +1306,7 @@ if ((ret == PROXY_INITIAL_READ) && (memcmp(&hdr.v2,
v2sig, sizeof(v2sig)) == 0))
{
do
{
- retmore = recv(fd, (uschar*)&hdr + ret, size-ret, 0);
+ retmore = read(fd, (uschar*)&hdr + ret, size-ret);
} while (retmore == -1 && errno == EINTR);
if (retmore == -1)
goto proxyfail;

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2656] proxy protocol support doesn't work in -bh (host_checking) mode [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2656

--- Comment #5 from Git Commit <git@exim.org> ---
Git commit:
https://git.exim.org/exim.git/commitdiff/db889856a56c1da9d18fc2f676b4aad2d45dc585

commit db889856a56c1da9d18fc2f676b4aad2d45dc585
Author: Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
AuthorDate: Fri Oct 2 08:19:12 2020 +0200
Commit: Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
CommitDate: Sun Oct 4 11:23:35 2020 +0200

use alarm() to set deadline on reading the proxy header (bug 2656)
----
src/src/macros.h | 1 -
src/src/smtp_in.c | 46 +++++++++++-----------------------------------
2 files changed, 11 insertions(+), 36 deletions(-)

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2656] proxy protocol support doesn't work in -bh (host_checking) mode [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2656

--- Comment #6 from Git Commit <git@exim.org> ---
Git commit:
https://git.exim.org/exim.git/commitdiff/ee359040f0c1e78c057bb1e533059c5c3d9e2c69

commit ee359040f0c1e78c057bb1e533059c5c3d9e2c69
Author: Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
AuthorDate: Sat Oct 3 18:58:11 2020 +0200
Commit: Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
CommitDate: Sun Oct 4 12:31:07 2020 +0200

testsuite: add test for proxy and -bh (bug 2656)
----
test/confs/4031 | 1 +
test/scripts/4030-proxy-protocol/4031 | 40 +++++++++++++
test/stderr/4031 | 102 ++++++++++++++++++++++++++++++++++
test/stdout/4031 | 53 ++++++++++++++++++
4 files changed, 196 insertions(+)

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##