From 037a0dc0835bb5a442bdcbeecdd5baed723f0b45 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 7 Dec 1999 15:38:31 +1100 Subject: - Merged more OpenBSD changes: - [atomicio.c authfd.c scp.c serverloop.c ssh.h sshconnect.c sshd.c] move atomicio into it's own file. wrap all socket write()s which were doing write(sock, buf, len) != len, with atomicio() calls. - [auth-skey.c] fd leak - [authfile.c] properly name fd variable - [channels.c] display great hatred towards strcpy - [pty.c pty.h sshd.c] use openpty() if it exists (it does on BSD4_4) - [tildexpand.c] check for ~ expansion past MAXPATHLEN - Modified helper.c to use new atomicio function. - Reformat Makefile a little - Moved RC4 routines from rc4.[ch] into helper.c - Added autoconf code to detect /dev/ptmx (Solaris) and /dev/ptc (AIX) --- scp.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'scp.c') diff --git a/scp.c b/scp.c index fec2f4328..5a3ec4470 100644 --- a/scp.c +++ b/scp.c @@ -45,7 +45,7 @@ */ #include "includes.h" -RCSID("$Id: scp.c,v 1.11 1999/11/25 01:31:26 damien Exp $"); +RCSID("$Id: scp.c,v 1.12 1999/12/07 04:38:32 damien Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -974,7 +974,7 @@ run_err(const char *fmt,...) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scp.c,v 1.11 1999/11/25 01:31:26 damien Exp $ + * $Id: scp.c,v 1.12 1999/12/07 04:38:32 damien Exp $ */ char * @@ -1065,30 +1065,6 @@ lostconn(signo) exit(1); } -/* - * ensure all of data on socket comes through. f==read || f==write - */ -int -atomicio(f, fd, s, n) - int (*f) (); - char *s; -{ - int res, pos = 0; - - while (n > pos) { - res = (f) (fd, s + pos, n - pos); - switch (res) { - case -1: - if (errno == EINTR || errno == EAGAIN) - continue; - case 0: - return (res); - default: - pos += res; - } - } - return (pos); -} void alarmtimer(int wait) -- cgit v1.2.3