Well, unless someone can repair connect, here's a very ugly hack that
should prevent SIGWINCH from fucking ftp up.
Index: fetch.c
===================================================================
RCS file: /build/data/openbsd/cvs/src/usr.bin/ftp/fetch.c,v
retrieving revision 1.147
diff -u -p -r1.147 fetch.c
--- fetch.c 27 May 2016 15:16:16 -0000 1.147
+++ fetch.c 8 Aug 2016 10:46:30 -0000
@@ -557,16 +557,25 @@ noslash:
}
#endif /* !SMALL */
+ {
+ sigset_t set;
+
+ sigemptyset(&set);
+ sigaddset(&set, SIGWINCH);
+ sigprocmask(SIG_BLOCK, &set, NULL);
+
again:
- if (connect(s, res->ai_addr, res->ai_addrlen) < 0) {
- if (errno == EINTR)
- goto again;
- save_errno = errno;
- close(s);
- errno = save_errno;
- s = -1;
- cause = "connect";
- continue;
+ if (connect(s, res->ai_addr, res->ai_addrlen) < 0) {
+ if (errno == EINTR)
+ goto again;
+ save_errno = errno;
+ close(s);
+ errno = save_errno;
+ s = -1;
+ cause = "connect";
+ continue;
+ }
+ sigprocmask(SIG_UNBLOCK, &set, NULL);
}
/* get port in numeric */
Index: ftp.c
===================================================================
RCS file: /build/data/openbsd/cvs/src/usr.bin/ftp/ftp.c,v
retrieving revision 1.96
diff -u -p -r1.96 ftp.c
--- ftp.c 16 Mar 2016 15:41:11 -0000 1.96
+++ ftp.c 8 Aug 2016 10:47:08 -0000
@@ -74,6 +74,7 @@
#include <errno.h>
#include <netdb.h>
#include <poll.h>
+#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -219,9 +220,18 @@ hookup(char *host, char *port)
}
}
#endif /* !SMALL */
- while ((error = connect(s, res->ai_addr, res->ai_addrlen)) < 0
- && errno == EINTR) {
- ;
+ {
+ sigset_t set;
+
+ sigemptyset(&set);
+ sigaddset(&set, SIGWINCH);
+ sigprocmask(SIG_BLOCK, &set, NULL);
+
+ while ((error = connect(s, res->ai_addr,
+ res->ai_addrlen)) < 0 && errno == EINTR) {
+ ;
+ }
+ sigprocmask(SIG_UNBLOCK, &set, NULL);
}
if (error) {
/* this "if" clause is to prevent print warning twice */