From 2372ace57287c6963a5790fb254e47de57537e0a Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 14 May 2003 13:42:23 +1000 Subject: - markus@cvs.openbsd.org 2003/04/14 14:17:50 [channels.c sshconnect.c sshd.c ssh-keyscan.c] avoid hardcoded SOCK_xx; with itojun@; should allow ssh over SCTP --- ssh-keyscan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ssh-keyscan.c') diff --git a/ssh-keyscan.c b/ssh-keyscan.c index 5b4eb82d1..ac3056ff2 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -7,7 +7,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.41 2003/02/16 17:09:57 markus Exp $"); +RCSID("$OpenBSD: ssh-keyscan.c,v 1.42 2003/04/14 14:17:50 markus Exp $"); #include "openbsd-compat/sys-queue.h" @@ -397,7 +397,7 @@ tcpconnect(char *host) if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) fatal("getaddrinfo %s: %s", host, gai_strerror(gaierr)); for (ai = aitop; ai; ai = ai->ai_next) { - s = socket(ai->ai_family, SOCK_STREAM, 0); + s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); if (s < 0) { error("socket: %s", strerror(errno)); continue; -- cgit v1.2.3 From ea5ade28fbc228b0e7cbaba30cee8579edaee845 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 14 May 2003 13:43:53 +1000 Subject: - deraadt@cvs.openbsd.org 2003/04/26 04:29:49 [ssh-keyscan.c] -t in usage(); rogier@quaak.org --- ChangeLog | 5 ++++- ssh-keyscan.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'ssh-keyscan.c') diff --git a/ChangeLog b/ChangeLog index 4f54c69b1..bc7eadf7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,9 @@ - markus@cvs.openbsd.org 2003/04/16 14:35:27 [auth.h] document struct Authctxt; with solar + - deraadt@cvs.openbsd.org 2003/04/26 04:29:49 + [ssh-keyscan.c] + -t in usage(); rogier@quaak.org 20030512 - (djm) Redhat spec: Don't install profile.d scripts when not @@ -1412,4 +1415,4 @@ save auth method before monitor_reset_key_state(); bugzilla bug #284; ok provos@ -$Id: ChangeLog,v 1.2683 2003/05/14 03:43:25 djm Exp $ +$Id: ChangeLog,v 1.2684 2003/05/14 03:43:53 djm Exp $ diff --git a/ssh-keyscan.c b/ssh-keyscan.c index ac3056ff2..6b1954269 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -7,7 +7,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.42 2003/04/14 14:17:50 markus Exp $"); +RCSID("$OpenBSD: ssh-keyscan.c,v 1.43 2003/04/26 04:29:49 deraadt Exp $"); #include "openbsd-compat/sys-queue.h" @@ -685,7 +685,7 @@ fatal(const char *fmt,...) static void usage(void) { - fprintf(stderr, "usage: %s [-v46] [-p port] [-T timeout] [-f file]\n" + fprintf(stderr, "usage: %s [-v46] [-p port] [-T timeout] [-t type] [-f file]\n" "\t\t [host | addrlist namelist] [...]\n", __progname); exit(1); -- cgit v1.2.3 From 7e1bbc55af32d8f5d81200323198c65b548faaad Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 18 May 2003 20:52:40 +1000 Subject: - (djm) Remove IPv4 by default hack now that we can specify AF in config --- ChangeLog | 3 ++- acconfig.h | 5 +---- configure.ac | 16 +--------------- ssh-keyscan.c | 4 ---- ssh.c | 4 ---- sshd.c | 4 ---- 6 files changed, 4 insertions(+), 32 deletions(-) (limited to 'ssh-keyscan.c') diff --git a/ChangeLog b/ChangeLog index 6b657c8ee..126f497aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ [readconf.c ssh_config ssh_config.5 ssh-keysign.c] add AddressFamily option to ssh_config (like -4, -6 on commandline). Portable bug #534; ok markus@ + - (djm) Remove IPv4 by default hack now that we can specify AF in config 20030517 - (bal) strcat -> strlcat on openbsd-compat/realpath.c (rev 1.8 OpenBSD) @@ -1561,4 +1562,4 @@ save auth method before monitor_reset_key_state(); bugzilla bug #284; ok provos@ -$Id: ChangeLog,v 1.2733 2003/05/18 10:50:30 djm Exp $ +$Id: ChangeLog,v 1.2734 2003/05/18 10:52:40 djm Exp $ diff --git a/acconfig.h b/acconfig.h index 8ea6b9ab8..7914deb52 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,4 +1,4 @@ -/* $Id: acconfig.h,v 1.153 2003/05/15 02:27:08 djm Exp $ */ +/* $Id: acconfig.h,v 1.154 2003/05/18 10:52:40 djm Exp $ */ #ifndef _CONFIG_H #define _CONFIG_H @@ -295,9 +295,6 @@ /* Specify location of ssh.pid */ #undef _PATH_SSH_PIDDIR -/* Use IPv4 for connection by default, IPv6 can still if explicity asked */ -#undef IPV4_DEFAULT - /* getaddrinfo is broken (if present) */ #undef BROKEN_GETADDRINFO diff --git a/configure.ac b/configure.ac index 99a85264c..bdc198592 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.121 2003/05/15 11:42:59 dtucker Exp $ +# $Id: configure.ac,v 1.122 2003/05/18 10:52:40 djm Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -95,7 +95,6 @@ case "$host" in AC_DEFINE(HAVE_CYGWIN) AC_DEFINE(USE_PIPES) AC_DEFINE(DISABLE_SHADOW) - AC_DEFINE(IPV4_DEFAULT) AC_DEFINE(IP_TOS_IS_BROKEN) AC_DEFINE(NO_X11_UNIX_SOCKETS) AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT) @@ -2249,18 +2248,6 @@ AC_ARG_WITH(superuser-path, ) -# Whether to force IPv4 by default (needed on broken glibc Linux) -IPV4_HACK_MSG="no" -AC_ARG_WITH(ipv4-default, - [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], - [ - if test "x$withval" != "xno" ; then - AC_DEFINE(IPV4_DEFAULT) - IPV4_HACK_MSG="yes" - fi - ] -) - AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses]) IPV4_IN6_HACK_MSG="no" AC_ARG_WITH(4in6, @@ -2601,7 +2588,6 @@ echo " S/KEY support: $SKEY_MSG" echo " TCP Wrappers support: $TCPW_MSG" echo " MD5 password support: $MD5_MSG" echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" -echo " Use IPv4 by default hack: $IPV4_HACK_MSG" echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" echo " BSD Auth support: $BSD_AUTH_MSG" echo " Random number source: $RAND_MSG" diff --git a/ssh-keyscan.c b/ssh-keyscan.c index 6b1954269..e2cd789b5 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -31,11 +31,7 @@ RCSID("$OpenBSD: ssh-keyscan.c,v 1.43 2003/04/26 04:29:49 deraadt Exp $"); /* Flag indicating whether IPv4 or IPv6. This can be set on the command line. Default value is AF_UNSPEC means both IPv4 and IPv6. */ -#ifdef IPV4_DEFAULT -int IPv4or6 = AF_INET; -#else int IPv4or6 = AF_UNSPEC; -#endif int ssh_port = SSH_DEFAULT_PORT; diff --git a/ssh.c b/ssh.c index 096116b8b..480bd85e6 100644 --- a/ssh.c +++ b/ssh.c @@ -81,11 +81,7 @@ char *__progname; /* Flag indicating whether IPv4 or IPv6. This can be set on the command line. Default value is AF_UNSPEC means both IPv4 and IPv6. */ -#ifdef IPV4_DEFAULT -int IPv4or6 = AF_INET; -#else int IPv4or6 = AF_UNSPEC; -#endif /* Flag indicating whether debug mode is on. This can be set on the command line. */ int debug_flag = 0; diff --git a/sshd.c b/sshd.c index c0221bea7..65837c938 100644 --- a/sshd.c +++ b/sshd.c @@ -112,11 +112,7 @@ char *config_file_name = _PATH_SERVER_CONFIG_FILE; * Flag indicating whether IPv4 or IPv6. This can be set on the command line. * Default value is AF_UNSPEC means both IPv4 and IPv6. */ -#ifdef IPV4_DEFAULT -int IPv4or6 = AF_INET; -#else int IPv4or6 = AF_UNSPEC; -#endif /* * Debug mode flag. This can be set on the command line. If debug -- cgit v1.2.3 From 9f63f22aa0ab13673f197642a66a98b09a18abd0 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 3 Jul 2003 13:46:56 +1000 Subject: - deraadt@cvs.openbsd.org 2003/06/28 16:23:06 [atomicio.c atomicio.h authfd.c clientloop.c monitor_wrap.c msg.c progressmeter.c scp.c sftp-client.c ssh-keyscan.c ssh.h sshconnect.c sshd.c] deal with typing of write vs read in atomicio --- ChangeLog | 7 ++++++- atomicio.c | 4 ++-- atomicio.h | 8 +++++--- authfd.c | 6 +++--- clientloop.c | 6 +++--- monitor_wrap.c | 6 +++--- msg.c | 6 +++--- progressmeter.c | 6 +++--- scp.c | 36 ++++++++++++++++++------------------ sftp-client.c | 8 ++++---- ssh-keyscan.c | 4 ++-- ssh.h | 3 ++- sshconnect.c | 4 ++-- sshd.c | 8 ++++---- 14 files changed, 60 insertions(+), 52 deletions(-) (limited to 'ssh-keyscan.c') diff --git a/ChangeLog b/ChangeLog index 130989988..8fdfce197 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,11 @@ [sshd.c] report pidfile creation errors, based on patch from Roumen Petrov; ok markus@ + - deraadt@cvs.openbsd.org 2003/06/28 16:23:06 + [atomicio.c atomicio.h authfd.c clientloop.c monitor_wrap.c msg.c + progressmeter.c scp.c sftp-client.c ssh-keyscan.c ssh.h sshconnect.c + sshd.c] + deal with typing of write vs read in atomicio 20030630 - (djm) Search for support functions necessary to build our @@ -624,4 +629,4 @@ - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. Report from murple@murple.net, diagnosis from dtucker@zip.com.au -$Id: ChangeLog,v 1.2836 2003/07/03 03:40:44 dtucker Exp $ +$Id: ChangeLog,v 1.2837 2003/07/03 03:46:56 dtucker Exp $ diff --git a/atomicio.c b/atomicio.c index 47161eb3a..dfc1553c5 100644 --- a/atomicio.c +++ b/atomicio.c @@ -24,7 +24,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: atomicio.c,v 1.10 2001/05/08 22:48:07 markus Exp $"); +RCSID("$OpenBSD: atomicio.c,v 1.11 2003/06/28 16:23:06 deraadt Exp $"); #include "atomicio.h" @@ -33,7 +33,7 @@ RCSID("$OpenBSD: atomicio.c,v 1.10 2001/05/08 22:48:07 markus Exp $"); */ ssize_t atomicio(f, fd, _s, n) - ssize_t (*f) (); + ssize_t (*f) (int, void *, size_t); int fd; void *_s; size_t n; diff --git a/atomicio.h b/atomicio.h index e569d38c6..5c0f392ef 100644 --- a/atomicio.h +++ b/atomicio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomicio.h,v 1.4 2001/06/26 06:32:46 itojun Exp $ */ +/* $OpenBSD: atomicio.h,v 1.5 2003/06/28 16:23:06 deraadt Exp $ */ /* * Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. @@ -26,6 +26,8 @@ */ /* - * Ensure all of data on socket comes through. f==read || f==write + * Ensure all of data on socket comes through. f==read || f==vwrite */ -ssize_t atomicio(ssize_t (*)(), int, void *, size_t); +ssize_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t); + +#define vwrite (ssize_t (*)(int, void *, size_t))write diff --git a/authfd.c b/authfd.c index 368544b17..c78db6d94 100644 --- a/authfd.c +++ b/authfd.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfd.c,v 1.60 2003/06/11 11:18:38 djm Exp $"); +RCSID("$OpenBSD: authfd.c,v 1.61 2003/06/28 16:23:06 deraadt Exp $"); #include @@ -122,8 +122,8 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply PUT_32BIT(buf, len); /* Send the length and then the packet to the agent. */ - if (atomicio(write, auth->fd, buf, 4) != 4 || - atomicio(write, auth->fd, buffer_ptr(request), + if (atomicio(vwrite, auth->fd, buf, 4) != 4 || + atomicio(vwrite, auth->fd, buffer_ptr(request), buffer_len(request)) != buffer_len(request)) { error("Error writing to authentication socket."); return 0; diff --git a/clientloop.c b/clientloop.c index 1c1acf481..d8def78bd 100644 --- a/clientloop.c +++ b/clientloop.c @@ -59,7 +59,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.111 2003/05/14 22:24:42 markus Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.112 2003/06/28 16:23:06 deraadt Exp $"); #include "ssh.h" #include "ssh1.h" @@ -395,9 +395,9 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr) /* Flush stdout and stderr buffers. */ if (buffer_len(bout) > 0) - atomicio(write, fileno(stdout), buffer_ptr(bout), buffer_len(bout)); + atomicio(vwrite, fileno(stdout), buffer_ptr(bout), buffer_len(bout)); if (buffer_len(berr) > 0) - atomicio(write, fileno(stderr), buffer_ptr(berr), buffer_len(berr)); + atomicio(vwrite, fileno(stderr), buffer_ptr(berr), buffer_len(berr)); leave_raw_mode(); diff --git a/monitor_wrap.c b/monitor_wrap.c index bd3a01a2b..10a79c035 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c @@ -25,7 +25,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_wrap.c,v 1.26 2003/04/07 08:29:57 markus Exp $"); +RCSID("$OpenBSD: monitor_wrap.c,v 1.27 2003/06/28 16:23:06 deraadt Exp $"); #include #include @@ -72,9 +72,9 @@ mm_request_send(int socket, enum monitor_reqtype type, Buffer *m) PUT_32BIT(buf, mlen + 1); buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */ - if (atomicio(write, socket, buf, sizeof(buf)) != sizeof(buf)) + if (atomicio(vwrite, socket, buf, sizeof(buf)) != sizeof(buf)) fatal("%s: write", __func__); - if (atomicio(write, socket, buffer_ptr(m), mlen) != mlen) + if (atomicio(vwrite, socket, buffer_ptr(m), mlen) != mlen) fatal("%s: write", __func__); } diff --git a/msg.c b/msg.c index 5d266c207..6a806c3f5 100644 --- a/msg.c +++ b/msg.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: msg.c,v 1.5 2002/12/19 00:07:02 djm Exp $"); +RCSID("$OpenBSD: msg.c,v 1.6 2003/06/28 16:23:06 deraadt Exp $"); #include "buffer.h" #include "getput.h" @@ -40,9 +40,9 @@ ssh_msg_send(int fd, u_char type, Buffer *m) PUT_32BIT(buf, mlen + 1); buf[4] = type; /* 1st byte of payload is mesg-type */ - if (atomicio(write, fd, buf, sizeof(buf)) != sizeof(buf)) + if (atomicio(vwrite, fd, buf, sizeof(buf)) != sizeof(buf)) fatal("ssh_msg_send: write"); - if (atomicio(write, fd, buffer_ptr(m), mlen) != mlen) + if (atomicio(vwrite, fd, buffer_ptr(m), mlen) != mlen) fatal("ssh_msg_send: write"); } diff --git a/progressmeter.c b/progressmeter.c index a3f14c929..6aa225adf 100644 --- a/progressmeter.c +++ b/progressmeter.c @@ -64,7 +64,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: progressmeter.c,v 1.7 2003/06/10 22:20:52 deraadt Exp $"); +RCSID("$OpenBSD: progressmeter.c,v 1.8 2003/06/28 16:23:06 deraadt Exp $"); #ifdef HAVE_LIBGEN_H #include @@ -132,7 +132,7 @@ stop_progress_meter(void) alarm(0); draw_progress_meter(); if (foregroundproc() != 0) - atomicio(write, fileno(stdout), "\n", 1); + atomicio(vwrite, fileno(stdout), "\n", 1); } static void @@ -255,7 +255,7 @@ draw_progress_meter(void) "%02d:%02d%s", i / 60, i % 60, (cursize != totalbytes) ? " ETA" : " "); } - atomicio(write, fileno(stdout), buf, strlen(buf)); + atomicio(vwrite, fileno(stdout), buf, strlen(buf)); } static int diff --git a/scp.c b/scp.c index 1cd0c55a4..81690609d 100644 --- a/scp.c +++ b/scp.c @@ -71,7 +71,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.106 2003/06/12 15:34:09 nino Exp $"); +RCSID("$OpenBSD: scp.c,v 1.107 2003/06/28 16:23:06 deraadt Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -549,7 +549,7 @@ syserr: run_err("%s: %s", name, strerror(errno)); (void) snprintf(buf, sizeof buf, "T%lu 0 %lu 0\n", (u_long) stb.st_mtime, (u_long) stb.st_atime); - (void) atomicio(write, remout, buf, strlen(buf)); + (void) atomicio(vwrite, remout, buf, strlen(buf)); if (response() < 0) goto next; } @@ -560,7 +560,7 @@ syserr: run_err("%s: %s", name, strerror(errno)); if (verbose_mode) { fprintf(stderr, "Sending file modes: %s", buf); } - (void) atomicio(write, remout, buf, strlen(buf)); + (void) atomicio(vwrite, remout, buf, strlen(buf)); if (response() < 0) goto next; if ((bp = allocbuf(&buffer, fd, 2048)) == NULL) { @@ -580,9 +580,9 @@ next: (void) close(fd); haderr = result >= 0 ? EIO : errno; } if (haderr) - (void) atomicio(write, remout, bp->buf, amt); + (void) atomicio(vwrite, remout, bp->buf, amt); else { - result = atomicio(write, remout, bp->buf, amt); + result = atomicio(vwrite, remout, bp->buf, amt); if (result != amt) haderr = result >= 0 ? EIO : errno; statbytes += result; @@ -596,7 +596,7 @@ next: (void) close(fd); if (close(fd) < 0 && !haderr) haderr = errno; if (!haderr) - (void) atomicio(write, remout, "", 1); + (void) atomicio(vwrite, remout, "", 1); else run_err("%s: %s", name, strerror(haderr)); (void) response(); @@ -623,7 +623,7 @@ rsource(char *name, struct stat *statp) (void) snprintf(path, sizeof(path), "T%lu 0 %lu 0\n", (u_long) statp->st_mtime, (u_long) statp->st_atime); - (void) atomicio(write, remout, path, strlen(path)); + (void) atomicio(vwrite, remout, path, strlen(path)); if (response() < 0) { closedir(dirp); return; @@ -633,7 +633,7 @@ rsource(char *name, struct stat *statp) (u_int) (statp->st_mode & FILEMODEMASK), 0, last); if (verbose_mode) fprintf(stderr, "Entering directory: %s", path); - (void) atomicio(write, remout, path, strlen(path)); + (void) atomicio(vwrite, remout, path, strlen(path)); if (response() < 0) { closedir(dirp); return; @@ -652,7 +652,7 @@ rsource(char *name, struct stat *statp) source(1, vect); } (void) closedir(dirp); - (void) atomicio(write, remout, "E\n", 2); + (void) atomicio(vwrite, remout, "E\n", 2); (void) response(); } @@ -742,7 +742,7 @@ sink(int argc, char **argv) if (targetshouldbedirectory) verifydir(targ); - (void) atomicio(write, remout, "", 1); + (void) atomicio(vwrite, remout, "", 1); if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode)) targisdir = 1; for (first = 1;; first = 0) { @@ -760,7 +760,7 @@ sink(int argc, char **argv) if (buf[0] == '\01' || buf[0] == '\02') { if (iamremote == 0) - (void) atomicio(write, STDERR_FILENO, + (void) atomicio(vwrite, STDERR_FILENO, buf + 1, strlen(buf + 1)); if (buf[0] == '\02') exit(1); @@ -768,7 +768,7 @@ sink(int argc, char **argv) continue; } if (buf[0] == 'E') { - (void) atomicio(write, remout, "", 1); + (void) atomicio(vwrite, remout, "", 1); return; } if (ch == '\n') @@ -790,7 +790,7 @@ sink(int argc, char **argv) atime.tv_usec = strtol(cp, &cp, 10); if (!cp || *cp++ != '\0') SCREWUP("atime.usec not delimited"); - (void) atomicio(write, remout, "", 1); + (void) atomicio(vwrite, remout, "", 1); continue; } if (*cp != 'C' && *cp != 'D') { @@ -875,7 +875,7 @@ sink(int argc, char **argv) bad: run_err("%s: %s", np, strerror(errno)); continue; } - (void) atomicio(write, remout, "", 1); + (void) atomicio(vwrite, remout, "", 1); if ((bp = allocbuf(&buffer, ofd, 4096)) == NULL) { (void) close(ofd); continue; @@ -912,7 +912,7 @@ bad: run_err("%s: %s", np, strerror(errno)); if (count == bp->cnt) { /* Keep reading so we stay sync'd up. */ if (wrerr == NO) { - j = atomicio(write, ofd, bp->buf, count); + j = atomicio(vwrite, ofd, bp->buf, count); if (j != count) { wrerr = YES; wrerrno = j >= 0 ? EIO : errno; @@ -925,7 +925,7 @@ bad: run_err("%s: %s", np, strerror(errno)); if (showprogress) stop_progress_meter(); if (count != 0 && wrerr == NO && - (j = atomicio(write, ofd, bp->buf, count)) != count) { + (j = atomicio(vwrite, ofd, bp->buf, count)) != count) { wrerr = YES; wrerrno = j >= 0 ? EIO : errno; } @@ -970,7 +970,7 @@ bad: run_err("%s: %s", np, strerror(errno)); run_err("%s: %s", np, strerror(wrerrno)); break; case NO: - (void) atomicio(write, remout, "", 1); + (void) atomicio(vwrite, remout, "", 1); break; case DISPLAYED: break; @@ -1005,7 +1005,7 @@ response(void) } while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n'); if (!iamremote) - (void) atomicio(write, STDERR_FILENO, rbuf, cp - rbuf); + (void) atomicio(vwrite, STDERR_FILENO, rbuf, cp - rbuf); ++errs; if (resp == 1) return (-1); diff --git a/sftp-client.c b/sftp-client.c index a48d56e69..ffff0fe5a 100644 --- a/sftp-client.c +++ b/sftp-client.c @@ -28,7 +28,7 @@ /* XXX: copy between two remote sites */ #include "includes.h" -RCSID("$OpenBSD: sftp-client.c,v 1.43 2003/04/08 20:21:29 itojun Exp $"); +RCSID("$OpenBSD: sftp-client.c,v 1.44 2003/06/28 16:23:06 deraadt Exp $"); #include "openbsd-compat/sys-queue.h" @@ -71,10 +71,10 @@ send_msg(int fd, Buffer *m) /* Send length first */ PUT_32BIT(mlen, buffer_len(m)); - if (atomicio(write, fd, mlen, sizeof(mlen)) <= 0) + if (atomicio(vwrite, fd, mlen, sizeof(mlen)) <= 0) fatal("Couldn't send packet: %s", strerror(errno)); - if (atomicio(write, fd, buffer_ptr(m), buffer_len(m)) <= 0) + if (atomicio(vwrite, fd, buffer_ptr(m), buffer_len(m)) <= 0) fatal("Couldn't send packet: %s", strerror(errno)); buffer_clear(m); @@ -875,7 +875,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, fatal("Received more data than asked for " "%u > %u", len, req->len); if ((lseek(local_fd, req->offset, SEEK_SET) == -1 || - atomicio(write, local_fd, data, len) != len) && + atomicio(vwrite, local_fd, data, len) != len) && !write_error) { write_errno = errno; write_error = 1; diff --git a/ssh-keyscan.c b/ssh-keyscan.c index e2cd789b5..358a1e353 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -7,7 +7,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.43 2003/04/26 04:29:49 deraadt Exp $"); +RCSID("$OpenBSD: ssh-keyscan.c,v 1.44 2003/06/28 16:23:06 deraadt Exp $"); #include "openbsd-compat/sys-queue.h" @@ -541,7 +541,7 @@ congreet(int s) n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n", c->c_keytype == KT_RSA1? PROTOCOL_MAJOR_1 : PROTOCOL_MAJOR_2, c->c_keytype == KT_RSA1? PROTOCOL_MINOR_1 : PROTOCOL_MINOR_2); - if (atomicio(write, s, buf, n) != n) { + if (atomicio(vwrite, s, buf, n) != n) { error("write (%s): %s", c->c_name, strerror(errno)); confree(s); return; diff --git a/ssh.h b/ssh.h index a2d47e1ef..25a9213f3 100644 --- a/ssh.h +++ b/ssh.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.h,v 1.71 2002/06/22 02:00:29 stevesk Exp $ */ +/* $OpenBSD: ssh.h,v 1.72 2003/06/28 16:23:06 deraadt Exp $ */ /* * Author: Tatu Ylonen @@ -107,3 +107,4 @@ #define SSH_RSA_MINIMUM_MODULUS_SIZE 768 #endif /* SSH_H */ + diff --git a/sshconnect.c b/sshconnect.c index 82f5539c1..364a62281 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect.c,v 1.145 2003/06/11 10:16:16 jakob Exp $"); +RCSID("$OpenBSD: sshconnect.c,v 1.146 2003/06/28 16:23:06 deraadt Exp $"); #include @@ -523,7 +523,7 @@ ssh_exchange_identification(void) compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1, compat20 ? PROTOCOL_MINOR_2 : minor1, SSH_VERSION); - if (atomicio(write, connection_out, buf, strlen(buf)) != strlen(buf)) + if (atomicio(vwrite, connection_out, buf, strlen(buf)) != strlen(buf)) fatal("write: %.100s", strerror(errno)); client_version_string = xstrdup(buf); chop(client_version_string); diff --git a/sshd.c b/sshd.c index b4cdc724a..fafe0c66d 100644 --- a/sshd.c +++ b/sshd.c @@ -42,7 +42,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.270 2003/06/28 07:48:10 djm Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.271 2003/06/28 16:23:06 deraadt Exp $"); #include #include @@ -369,7 +369,7 @@ sshd_exchange_identification(int sock_in, int sock_out) if (client_version_string == NULL) { /* Send our protocol version identification. */ - if (atomicio(write, sock_out, server_version_string, + if (atomicio(vwrite, sock_out, server_version_string, strlen(server_version_string)) != strlen(server_version_string)) { logit("Could not write ident string to %s", get_remote_ipaddr()); @@ -408,7 +408,7 @@ sshd_exchange_identification(int sock_in, int sock_out) if (sscanf(client_version_string, "SSH-%d.%d-%[^\n]\n", &remote_major, &remote_minor, remote_version) != 3) { s = "Protocol mismatch.\n"; - (void) atomicio(write, sock_out, s, strlen(s)); + (void) atomicio(vwrite, sock_out, s, strlen(s)); close(sock_in); close(sock_out); logit("Bad protocol version identification '%.100s' from %s", @@ -469,7 +469,7 @@ sshd_exchange_identification(int sock_in, int sock_out) if (mismatch) { s = "Protocol major versions differ.\n"; - (void) atomicio(write, sock_out, s, strlen(s)); + (void) atomicio(vwrite, sock_out, s, strlen(s)); close(sock_in); close(sock_out); logit("Protocol major versions differ for %s: %.200s vs. %.200s", -- cgit v1.2.3 From 59d3d5b8b4813bdd1d4518d6839bd392ff6d21f7 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 22 Aug 2003 09:34:41 +1000 Subject: - (djm) s/get_progname/ssh_get_progname/g to avoid conflict with Heimdal -lbroken; ok dtucker --- ChangeLog | 6 +++++- logintest.c | 4 ++-- openbsd-compat/bsd-misc.c | 4 ++-- openbsd-compat/bsd-misc.h | 4 ++-- scp.c | 2 +- sftp-server.c | 2 +- sftp.c | 2 +- ssh-add.c | 2 +- ssh-agent.c | 2 +- ssh-keygen.c | 2 +- ssh-keyscan.c | 2 +- ssh-rand-helper.c | 4 ++-- ssh.c | 2 +- sshd.c | 2 +- 14 files changed, 22 insertions(+), 18 deletions(-) (limited to 'ssh-keyscan.c') diff --git a/ChangeLog b/ChangeLog index 081b07907..ded30f05a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20030822 + - (djm) s/get_progname/ssh_get_progname/g to avoid conflict with Heimdal + -lbroken; ok dtucker + 20030821 - (dtucker) OpenBSD CVS Sync - markus@cvs.openbsd.org 2003/08/14 16:08:58 @@ -845,4 +849,4 @@ - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. Report from murple@murple.net, diagnosis from dtucker@zip.com.au -$Id: ChangeLog,v 1.2896 2003/08/21 07:58:29 dtucker Exp $ +$Id: ChangeLog,v 1.2897 2003/08/21 23:34:41 djm Exp $ diff --git a/logintest.c b/logintest.c index a0c08118b..3f3997d10 100644 --- a/logintest.c +++ b/logintest.c @@ -43,7 +43,7 @@ #include "loginrec.h" -RCSID("$Id: logintest.c,v 1.9 2003/06/02 00:42:17 djm Exp $"); +RCSID("$Id: logintest.c,v 1.10 2003/08/21 23:34:41 djm Exp $"); #ifdef HAVE___PROGNAME extern char *__progname; @@ -287,7 +287,7 @@ main(int argc, char *argv[]) { printf("Platform-independent login recording test driver\n"); - __progname = get_progname(argv[0]); + __progname = ssh_get_progname(argv[0]); if (argc == 2) { if (strncmp(argv[1], "-i", 3) == 0) compile_opts_only = 1; diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index d4c793724..56cb45ade 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -25,13 +25,13 @@ #include "includes.h" #include "xmalloc.h" -RCSID("$Id: bsd-misc.c,v 1.17 2003/08/13 10:48:07 dtucker Exp $"); +RCSID("$Id: bsd-misc.c,v 1.18 2003/08/21 23:34:42 djm Exp $"); /* * NB. duplicate __progname in case it is an alias for argv[0] * Otherwise it may get clobbered by setproctitle() */ -char *get_progname(char *argv0) +char *ssh_get_progname(char *argv0) { #ifdef HAVE___PROGNAME extern char *__progname; diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index f2fbdc2e3..2857de59b 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h @@ -22,14 +22,14 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: bsd-misc.h,v 1.10 2003/08/13 10:48:07 dtucker Exp $ */ +/* $Id: bsd-misc.h,v 1.11 2003/08/21 23:34:42 djm Exp $ */ #ifndef _BSD_MISC_H #define _BSD_MISC_H #include "config.h" -char *get_progname(char *); +char *ssh_get_progname(char *); #ifndef HAVE_SETSID #define setsid() setpgrp(0, getpid()) diff --git a/scp.c b/scp.c index cf979f250..4f9247c2d 100644 --- a/scp.c +++ b/scp.c @@ -222,7 +222,7 @@ main(int argc, char **argv) extern char *optarg; extern int optind; - __progname = get_progname(argv[0]); + __progname = ssh_get_progname(argv[0]); args.list = NULL; addargs(&args, "ssh"); /* overwritten with ssh_program */ diff --git a/sftp-server.c b/sftp-server.c index 250814d72..9166853ed 100644 --- a/sftp-server.c +++ b/sftp-server.c @@ -1030,7 +1030,7 @@ main(int ac, char **av) /* XXX should use getopt */ - __progname = get_progname(av[0]); + __progname = ssh_get_progname(av[0]); handle_init(); #ifdef DEBUG_SFTP_SERVER diff --git a/sftp.c b/sftp.c index 4354bfd44..c2a6593b8 100644 --- a/sftp.c +++ b/sftp.c @@ -132,7 +132,7 @@ main(int argc, char **argv) extern int optind; extern char *optarg; - __progname = get_progname(argv[0]); + __progname = ssh_get_progname(argv[0]); args.list = NULL; addargs(&args, "ssh"); /* overwritten with ssh_program */ addargs(&args, "-oForwardX11 no"); diff --git a/ssh-add.c b/ssh-add.c index 5b0fbbce6..2e394e5c1 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -319,7 +319,7 @@ main(int argc, char **argv) char *sc_reader_id = NULL; int i, ch, deleting = 0, ret = 0; - __progname = get_progname(argv[0]); + __progname = ssh_get_progname(argv[0]); init_rng(); seed_rng(); diff --git a/ssh-agent.c b/ssh-agent.c index 6c8ff30dd..c05c61468 100644 --- a/ssh-agent.c +++ b/ssh-agent.c @@ -1024,7 +1024,7 @@ main(int ac, char **av) SSLeay_add_all_algorithms(); - __progname = get_progname(av[0]); + __progname = ssh_get_progname(av[0]); init_rng(); seed_rng(); diff --git a/ssh-keygen.c b/ssh-keygen.c index 2ce5553f6..dbc514737 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -809,7 +809,7 @@ main(int ac, char **av) extern int optind; extern char *optarg; - __progname = get_progname(av[0]); + __progname = ssh_get_progname(av[0]); SSLeay_add_all_algorithms(); log_init(av[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1); diff --git a/ssh-keyscan.c b/ssh-keyscan.c index 358a1e353..9fa8aaebc 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -697,7 +697,7 @@ main(int argc, char **argv) extern int optind; extern char *optarg; - __progname = get_progname(argv[0]); + __progname = ssh_get_progname(argv[0]); init_rng(); seed_rng(); TAILQ_INIT(&tq); diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c index 88e6e7c05..7e65e4569 100644 --- a/ssh-rand-helper.c +++ b/ssh-rand-helper.c @@ -39,7 +39,7 @@ #include "pathnames.h" #include "log.h" -RCSID("$Id: ssh-rand-helper.c,v 1.12 2003/07/06 05:20:46 dtucker Exp $"); +RCSID("$Id: ssh-rand-helper.c,v 1.13 2003/08/21 23:34:41 djm Exp $"); /* Number of bytes we write out */ #define OUTPUT_SEED_SIZE 48 @@ -769,7 +769,7 @@ main(int argc, char **argv) extern char *optarg; LogLevel ll; - __progname = get_progname(argv[0]); + __progname = ssh_get_progname(argv[0]); log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1); ll = SYSLOG_LEVEL_INFO; diff --git a/ssh.c b/ssh.c index 694bb5acc..46640a857 100644 --- a/ssh.c +++ b/ssh.c @@ -212,7 +212,7 @@ main(int ac, char **av) extern int optind, optreset; extern char *optarg; - __progname = get_progname(av[0]); + __progname = ssh_get_progname(av[0]); init_rng(); /* diff --git a/sshd.c b/sshd.c index dc275b0cb..0e1bde3a3 100644 --- a/sshd.c +++ b/sshd.c @@ -819,7 +819,7 @@ main(int ac, char **av) #ifdef HAVE_SECUREWARE (void)set_auth_parameters(ac, av); #endif - __progname = get_progname(av[0]); + __progname = ssh_get_progname(av[0]); init_rng(); /* Save argv. Duplicate so setproctitle emulation doesn't clobber it */ -- cgit v1.2.3