summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-12-07 15:38:31 +1100
committerDamien Miller <djm@mindrot.org>1999-12-07 15:38:31 +1100
commit037a0dc0835bb5a442bdcbeecdd5baed723f0b45 (patch)
treed02954d57ac437fd036e3e9544f24559ca8f0f0f /scp.c
parenteabf3417bc73ca9546a3ed489cd809ffdf303853 (diff)
- 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)
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/scp.c b/scp.c
index fec2f4328..5a3ec4470 100644
--- a/scp.c
+++ b/scp.c
@@ -45,7 +45,7 @@
45 */ 45 */
46 46
47#include "includes.h" 47#include "includes.h"
48RCSID("$Id: scp.c,v 1.11 1999/11/25 01:31:26 damien Exp $"); 48RCSID("$Id: scp.c,v 1.12 1999/12/07 04:38:32 damien Exp $");
49 49
50#include "ssh.h" 50#include "ssh.h"
51#include "xmalloc.h" 51#include "xmalloc.h"
@@ -974,7 +974,7 @@ run_err(const char *fmt,...)
974 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 974 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
975 * SUCH DAMAGE. 975 * SUCH DAMAGE.
976 * 976 *
977 * $Id: scp.c,v 1.11 1999/11/25 01:31:26 damien Exp $ 977 * $Id: scp.c,v 1.12 1999/12/07 04:38:32 damien Exp $
978 */ 978 */
979 979
980char * 980char *
@@ -1065,30 +1065,6 @@ lostconn(signo)
1065 exit(1); 1065 exit(1);
1066} 1066}
1067 1067
1068/*
1069 * ensure all of data on socket comes through. f==read || f==write
1070 */
1071int
1072atomicio(f, fd, s, n)
1073 int (*f) ();
1074 char *s;
1075{
1076 int res, pos = 0;
1077
1078 while (n > pos) {
1079 res = (f) (fd, s + pos, n - pos);
1080 switch (res) {
1081 case -1:
1082 if (errno == EINTR || errno == EAGAIN)
1083 continue;
1084 case 0:
1085 return (res);
1086 default:
1087 pos += res;
1088 }
1089 }
1090 return (pos);
1091}
1092 1068
1093void 1069void
1094alarmtimer(int wait) 1070alarmtimer(int wait)