diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2025-12-04 14:42:01 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2025-12-04 14:42:01 +0000 |
| commit | b28aa0de85b6b54ba40db198205e06c58c34022e (patch) | |
| tree | a919b35cfc639a5668eb9a04bad369e04f42f002 | |
| parent | d503769a62b282ad5589f1ccb18ef32e662d8373 (diff) | |
| download | smtpd-starttls-proxy-b28aa0de85b6b54ba40db198205e06c58c34022e.tar.gz | |
bugfix: turn socket blocking before handing off to the TLS tunnel
| -rw-r--r-- | package/deps-build | 4 | ||||
| -rw-r--r-- | src/smtpd-starttls-proxy/smtpd-starttls-proxy-io.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/package/deps-build b/package/deps-build index 2ee3ea6..ddbd907 100644 --- a/package/deps-build +++ b/package/deps-build @@ -1,2 +1,2 @@ -true true /package/prog/skalibs 2.14.4.0 libskarnet -true false /package/admin/s6 2.13.2.0 libs6 +true true /package/prog/skalibs 2.14.5.0 libskarnet +true false /package/admin/s6 2.14.0.0 libs6 diff --git a/src/smtpd-starttls-proxy/smtpd-starttls-proxy-io.c b/src/smtpd-starttls-proxy/smtpd-starttls-proxy-io.c index e9ef7ab..98345a8 100644 --- a/src/smtpd-starttls-proxy/smtpd-starttls-proxy-io.c +++ b/src/smtpd-starttls-proxy/smtpd-starttls-proxy-io.c @@ -236,7 +236,7 @@ static void child (int fdr, int fdw) tain deadline ; PROG = "smtpd-starttls-proxy-io" ; - if (ndelay_on(0) < 0 || ndelay_on(1) < 0 || ndelay_on(fdr) < 0 || ndelay_on(fdw) < 0) + if (ndelay_on(0) == -1 || ndelay_on(1) == -1 || ndelay_on(fdr) == -1 || ndelay_on(fdw) == -1) strerr_diefu1sys(111, "make fds non-blocking") ; buffer_init(&io[1].in, &buffer_read, fdr, io[1].inbuf, INSIZE) ; buffer_init(&io[1].out, &buffer_write, fdw, io[1].outbuf, OUTSIZE) ; @@ -326,6 +326,8 @@ static void child (int fdr, int fdw) if (wantexec >= 2) { int got = 0 ; + if (ndelay_off(0) == -1 || ndelay_off(1) == -1) + strerr_diefu1sys(111, "make fds blocking") ; if (write(fdctl, "Y", 1) != 1) strerr_diefu1sys(111, "send ucspi-tls start command") ; fd_shutdown(fdctl, 1) ; |
