1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-20 04:02:27 +00:00
freebsd-ports/security/ssh2/files/patch-lib::sshreadline::sshreadline.c
Marius Strobl d47f13ae97 - Cast the arguments of ssh_conn_send_channel_data_type() and
ssh_encode_{array_alloc,buffer}() calls as appropriate in order to
  fix argument size problems on 64-bit platforms and that manifest
  themselves on amd64 and ia64. [1]
- Allow the tcsetattr(3) calls in ssh_rl_{restore,set}_tty_modes_for_fd()
  to be interrupted by signal. This fixes occasional problems when
  connecting to a host for the first time.
- Use the base zlib instead of the one shipping with SSH; although the
  latter has an enhancement allowing a minor SSH-specific optimization,
  using the base one has the benefit of not needing to track security
  vulnerabilities of zlib in this port (SSH 3.2.9.1 ships with zlib
  1.1.4 which is not know to be vulnerable though).
- Try to make the description of the WITHOUT_X11 option of the port
  Makefile to be more sentence-like.

PR:		98016 [1]
Approved by:	netchild
Obtained from:	NetBSD [1]
2006-08-28 00:03:21 +00:00

33 lines
1.0 KiB
C

--- lib/sshreadline/sshreadline.c.orig Wed Dec 3 14:17:20 2003
+++ lib/sshreadline/sshreadline.c Fri Aug 18 20:58:55 2006
@@ -500,8 +500,13 @@
new_term.c_lflag &= ~(ECHO | ICANON);
new_term.c_cc[VMIN] = 1;
new_term.c_cc[VTIME] = 1;
- if (tcsetattr(fd, TCSAFLUSH, &new_term) < 0)
+ while (tcsetattr(fd, TCSAFLUSH, &new_term) < 0)
{
+ if (errno == EINTR)
+ {
+ errno = 0; /* For Solaris; just to make sure. */
+ continue;
+ }
ssh_warning("tcsetattr failed in ssh_rl_set_tty_modes_for_fd: "
"fd %d: %.200s", fd, strerror(errno));
return -1;
@@ -561,8 +566,13 @@
{
fcntl(fd, F_SETFL, fcntl_flags);
- if (tcsetattr(fd, TCSAFLUSH, saved_tio) < 0)
+ while (tcsetattr(fd, TCSAFLUSH, saved_tio) < 0)
{
+ if (errno == EINTR)
+ {
+ errno = 0; /* For Solaris; just to make sure. */
+ continue;
+ }
ssh_warning("tcsetattr failed in ssh_rl_restore_tty_modes_for_fd: "
"fd %d: %.200s", fd, strerror(errno));
return -1;