From 9834cab32ef1abd8f0e4e74852ac52c35cfce0ef Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 19 Mar 2006 00:07:07 +1100 Subject: - (dtucker) [openbsd-compat/bsd-snprintf.c] Bug #1173: make fmtint() take a LLONG rather than a long. Fixes scp'ing of large files on platforms with missing/broken snprintfs. Patch from e.borovac at bom.gov.au. --- openbsd-compat/bsd-snprintf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'openbsd-compat/bsd-snprintf.c') diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index e4ba154fd..571c61fc0 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -89,7 +89,7 @@ #include "includes.h" -RCSID("$Id: bsd-snprintf.c,v 1.11 2005/12/17 11:32:04 dtucker Exp $"); +RCSID("$Id: bsd-snprintf.c,v 1.12 2006/03/18 13:07:07 dtucker Exp $"); #if defined(BROKEN_SNPRINTF) /* For those with broken snprintf() */ # undef HAVE_SNPRINTF @@ -161,7 +161,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, char *value, int flags, int min, int max); static void fmtint(char *buffer, size_t *currlen, size_t maxlen, - long value, int base, int min, int max, int flags); + LLONG value, int base, int min, int max, int flags); static void fmtfp(char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, int min, int max, int flags); static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); @@ -468,10 +468,10 @@ static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, /* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ static void fmtint(char *buffer, size_t *currlen, size_t maxlen, - long value, int base, int min, int max, int flags) + LLONG value, int base, int min, int max, int flags) { int signvalue = 0; - unsigned long uvalue; + unsigned LLONG uvalue; char convert[20]; int place = 0; int spadlen = 0; /* amount to space pad */ -- cgit v1.2.3 From b0fb6872ed2efe3a116083e43dd4f5f47cd4882b Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 26 Mar 2006 00:03:21 +1100 Subject: - deraadt@cvs.openbsd.org 2006/03/19 18:51:18 [atomicio.c auth-bsdauth.c auth-chall.c auth-krb5.c auth-options.c] [auth-pam.c auth-passwd.c auth-rh-rsa.c auth-rhosts.c auth-rsa.c] [auth-shadow.c auth-skey.c auth.c auth1.c auth2-chall.c] [auth2-hostbased.c auth2-kbdint.c auth2-none.c auth2-passwd.c] [auth2-pubkey.c auth2.c authfd.c authfile.c bufaux.c buffer.c] [canohost.c channels.c cipher-3des1.c cipher-acss.c cipher-aes.c] [cipher-bf1.c cipher-ctr.c cipher.c cleanup.c clientloop.c compat.c] [compress.c deattack.c dh.c dispatch.c dns.c entropy.c fatal.c] [groupaccess.c hostfile.c includes.h kex.c kexdh.c kexdhc.c] [kexdhs.c kexgex.c kexgexc.c kexgexs.c key.c log.c loginrec.c] [loginrec.h logintest.c mac.c match.c md-sha256.c md5crypt.c misc.c] [monitor.c monitor_fdpass.c monitor_mm.c monitor_wrap.c msg.c] [nchan.c packet.c progressmeter.c readconf.c readpass.c rsa.c] [scard.c scp.c servconf.c serverloop.c session.c sftp-client.c] [sftp-common.c sftp-glob.c sftp-server.c sftp.c ssh-add.c] [ssh-agent.c ssh-dss.c ssh-keygen.c ssh-keyscan.c ssh-keysign.c] [ssh-rand-helper.c ssh-rsa.c ssh.c sshconnect.c sshconnect1.c] [sshconnect2.c sshd.c sshlogin.c sshpty.c sshtty.c ttymodes.c] [uidswap.c uuencode.c xmalloc.c openbsd-compat/bsd-arc4random.c] [openbsd-compat/bsd-closefrom.c openbsd-compat/bsd-cygwin_util.c] [openbsd-compat/bsd-getpeereid.c openbsd-compat/bsd-misc.c] [openbsd-compat/bsd-nextstep.c openbsd-compat/bsd-snprintf.c] [openbsd-compat/bsd-waitpid.c openbsd-compat/fake-rfc2553.c] RCSID() can die --- ChangeLog | 27 ++++++++++++++++++++++++++- atomicio.c | 1 - auth-bsdauth.c | 1 - auth-chall.c | 1 - auth-krb5.c | 1 - auth-options.c | 1 - auth-pam.c | 1 - auth-passwd.c | 1 - auth-rh-rsa.c | 1 - auth-rhosts.c | 1 - auth-rsa.c | 1 - auth-shadow.c | 1 - auth-skey.c | 1 - auth.c | 1 - auth1.c | 1 - auth2-chall.c | 1 - auth2-hostbased.c | 1 - auth2-kbdint.c | 1 - auth2-none.c | 1 - auth2-passwd.c | 1 - auth2-pubkey.c | 1 - auth2.c | 1 - authfd.c | 1 - authfile.c | 1 - bufaux.c | 1 - buffer.c | 1 - canohost.c | 1 - channels.c | 1 - cipher-3des1.c | 1 - cipher-acss.c | 2 -- cipher-aes.c | 1 - cipher-bf1.c | 1 - cipher-ctr.c | 1 - cipher.c | 1 - cleanup.c | 1 - clientloop.c | 1 - compat.c | 1 - compress.c | 1 - deattack.c | 1 - dh.c | 1 - dispatch.c | 1 - dns.c | 3 +-- entropy.c | 2 -- fatal.c | 1 - groupaccess.c | 1 - hostfile.c | 1 - includes.h | 5 +---- kex.c | 1 - kexdh.c | 1 - kexdhc.c | 1 - kexdhs.c | 1 - kexgex.c | 1 - kexgexc.c | 1 - kexgexs.c | 1 - key.c | 1 - log.c | 1 - loginrec.c | 2 -- loginrec.h | 2 -- logintest.c | 2 -- mac.c | 1 - match.c | 1 - md-sha256.c | 2 -- md5crypt.c | 2 -- misc.c | 1 - monitor.c | 1 - monitor_fdpass.c | 1 - monitor_mm.c | 1 - monitor_wrap.c | 1 - msg.c | 1 - nchan.c | 1 - openbsd-compat/bsd-arc4random.c | 2 -- openbsd-compat/bsd-closefrom.c | 2 -- openbsd-compat/bsd-cygwin_util.c | 2 -- openbsd-compat/bsd-getpeereid.c | 2 -- openbsd-compat/bsd-misc.c | 2 -- openbsd-compat/bsd-nextstep.c | 2 -- openbsd-compat/bsd-snprintf.c | 2 -- openbsd-compat/bsd-waitpid.c | 2 -- openbsd-compat/fake-rfc2553.c | 2 -- packet.c | 1 - progressmeter.c | 1 - readconf.c | 1 - readpass.c | 1 - rsa.c | 1 - scard.c | 1 - scp.c | 1 - servconf.c | 1 - serverloop.c | 1 - session.c | 1 - sftp-client.c | 1 - sftp-common.c | 1 - sftp-glob.c | 1 - sftp-server.c | 1 - sftp.c | 1 - ssh-add.c | 1 - ssh-agent.c | 1 - ssh-dss.c | 1 - ssh-keygen.c | 1 - ssh-keyscan.c | 1 - ssh-keysign.c | 1 - ssh-rand-helper.c | 2 -- ssh-rsa.c | 1 - ssh.c | 1 - sshconnect.c | 1 - sshconnect1.c | 1 - sshconnect2.c | 1 - sshd.c | 1 - sshlogin.c | 1 - sshpty.c | 1 - sshtty.c | 1 - ttymodes.c | 1 - uidswap.c | 1 - uuencode.c | 1 - xmalloc.c | 1 - 114 files changed, 28 insertions(+), 135 deletions(-) (limited to 'openbsd-compat/bsd-snprintf.c') diff --git a/ChangeLog b/ChangeLog index 2281accdc..64a20a4c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,31 @@ [ssh.1] Add RFC4419 (Diffie-Hellman group exchange KEX) to the list of SSH RFCs that OpenSSH supports + - deraadt@cvs.openbsd.org 2006/03/19 18:51:18 + [atomicio.c auth-bsdauth.c auth-chall.c auth-krb5.c auth-options.c] + [auth-pam.c auth-passwd.c auth-rh-rsa.c auth-rhosts.c auth-rsa.c] + [auth-shadow.c auth-skey.c auth.c auth1.c auth2-chall.c] + [auth2-hostbased.c auth2-kbdint.c auth2-none.c auth2-passwd.c] + [auth2-pubkey.c auth2.c authfd.c authfile.c bufaux.c buffer.c] + [canohost.c channels.c cipher-3des1.c cipher-acss.c cipher-aes.c] + [cipher-bf1.c cipher-ctr.c cipher.c cleanup.c clientloop.c compat.c] + [compress.c deattack.c dh.c dispatch.c dns.c entropy.c fatal.c] + [groupaccess.c hostfile.c includes.h kex.c kexdh.c kexdhc.c] + [kexdhs.c kexgex.c kexgexc.c kexgexs.c key.c log.c loginrec.c] + [loginrec.h logintest.c mac.c match.c md-sha256.c md5crypt.c misc.c] + [monitor.c monitor_fdpass.c monitor_mm.c monitor_wrap.c msg.c] + [nchan.c packet.c progressmeter.c readconf.c readpass.c rsa.c] + [scard.c scp.c servconf.c serverloop.c session.c sftp-client.c] + [sftp-common.c sftp-glob.c sftp-server.c sftp.c ssh-add.c] + [ssh-agent.c ssh-dss.c ssh-keygen.c ssh-keyscan.c ssh-keysign.c] + [ssh-rand-helper.c ssh-rsa.c ssh.c sshconnect.c sshconnect1.c] + [sshconnect2.c sshd.c sshlogin.c sshpty.c sshtty.c ttymodes.c] + [uidswap.c uuencode.c xmalloc.c openbsd-compat/bsd-arc4random.c] + [openbsd-compat/bsd-closefrom.c openbsd-compat/bsd-cygwin_util.c] + [openbsd-compat/bsd-getpeereid.c openbsd-compat/bsd-misc.c] + [openbsd-compat/bsd-nextstep.c openbsd-compat/bsd-snprintf.c] + [openbsd-compat/bsd-waitpid.c openbsd-compat/fake-rfc2553.c] + RCSID() can die 20060318 - (djm) [auth-pam.c] Fix memleak in error path, from Coverity via @@ -4196,4 +4221,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4231 2006/03/25 12:39:29 djm Exp $ +$Id: ChangeLog,v 1.4232 2006/03/25 13:03:21 djm Exp $ diff --git a/atomicio.c b/atomicio.c index 8dd271b6d..afe306b1b 100644 --- a/atomicio.c +++ b/atomicio.c @@ -25,7 +25,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: atomicio.c,v 1.14 2006/02/11 19:31:18 otto Exp $"); #include "atomicio.h" diff --git a/auth-bsdauth.c b/auth-bsdauth.c index 920c977d8..f48b43174 100644 --- a/auth-bsdauth.c +++ b/auth-bsdauth.c @@ -22,7 +22,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth-bsdauth.c,v 1.6 2005/01/19 13:11:47 dtucker Exp $"); #ifdef BSD_AUTH #include "xmalloc.h" diff --git a/auth-chall.c b/auth-chall.c index e4f783096..7707023a4 100644 --- a/auth-chall.c +++ b/auth-chall.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-chall.c,v 1.9 2003/11/03 09:03:37 djm Exp $"); #include "auth.h" #include "log.h" diff --git a/auth-krb5.c b/auth-krb5.c index 64d613543..8bdc64edf 100644 --- a/auth-krb5.c +++ b/auth-krb5.c @@ -28,7 +28,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-krb5.c,v 1.16 2005/11/21 09:42:10 dtucker Exp $"); #include "ssh.h" #include "ssh1.h" diff --git a/auth-options.c b/auth-options.c index ad97e6129..77488a49d 100644 --- a/auth-options.c +++ b/auth-options.c @@ -10,7 +10,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-options.c,v 1.33 2005/12/08 18:34:11 reyk Exp $"); #include "xmalloc.h" #include "match.h" diff --git a/auth-pam.c b/auth-pam.c index 2d975c394..3d64de76a 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -47,7 +47,6 @@ /* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ #include "includes.h" -RCSID("$Id: auth-pam.c,v 1.130 2006/03/18 12:04:49 djm Exp $"); #include #include diff --git a/auth-passwd.c b/auth-passwd.c index 6e6d0d76a..df202dde3 100644 --- a/auth-passwd.c +++ b/auth-passwd.c @@ -36,7 +36,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-passwd.c,v 1.34 2005/07/19 15:32:26 otto Exp $"); #include "packet.h" #include "buffer.h" diff --git a/auth-rh-rsa.c b/auth-rh-rsa.c index c31f2b97b..f9c386dba 100644 --- a/auth-rh-rsa.c +++ b/auth-rh-rsa.c @@ -13,7 +13,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rh-rsa.c,v 1.38 2005/07/17 07:17:54 djm Exp $"); #include "packet.h" #include "uidswap.h" diff --git a/auth-rhosts.c b/auth-rhosts.c index 1deeb30b9..098893563 100644 --- a/auth-rhosts.c +++ b/auth-rhosts.c @@ -14,7 +14,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rhosts.c,v 1.35 2006/02/20 17:19:53 stevesk Exp $"); #include #include diff --git a/auth-rsa.c b/auth-rsa.c index 275c0b67b..effff5d2a 100644 --- a/auth-rsa.c +++ b/auth-rsa.c @@ -14,7 +14,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rsa.c,v 1.64 2006/02/20 17:19:53 stevesk Exp $"); #include #include diff --git a/auth-shadow.c b/auth-shadow.c index 59737b93c..c8d5dd3c1 100644 --- a/auth-shadow.c +++ b/auth-shadow.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$Id: auth-shadow.c,v 1.7 2005/07/17 07:04:47 djm Exp $"); #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE) #include diff --git a/auth-skey.c b/auth-skey.c index f676dbec9..ce8c1a809 100644 --- a/auth-skey.c +++ b/auth-skey.c @@ -22,7 +22,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth-skey.c,v 1.20 2002/06/30 21:59:45 deraadt Exp $"); #ifdef SKEY diff --git a/auth.c b/auth.c index fca373b80..35bc5ea1d 100644 --- a/auth.c +++ b/auth.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth.c,v 1.62 2006/02/20 17:19:53 stevesk Exp $"); #include #include diff --git a/auth1.c b/auth1.c index 4bc2bf76d..cc1092abf 100644 --- a/auth1.c +++ b/auth1.c @@ -10,7 +10,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth1.c,v 1.62 2005/07/16 01:35:24 djm Exp $"); #include "xmalloc.h" #include "rsa.h" diff --git a/auth2-chall.c b/auth2-chall.c index b147cadf3..8860a94c5 100644 --- a/auth2-chall.c +++ b/auth2-chall.c @@ -23,7 +23,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth2-chall.c,v 1.24 2005/07/17 07:17:54 djm Exp $"); #include "ssh2.h" #include "auth.h" diff --git a/auth2-hostbased.c b/auth2-hostbased.c index 1111ed67a..251828496 100644 --- a/auth2-hostbased.c +++ b/auth2-hostbased.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2-hostbased.c,v 1.6 2004/01/19 21:25:15 markus Exp $"); #include "ssh2.h" #include "xmalloc.h" diff --git a/auth2-kbdint.c b/auth2-kbdint.c index fa8364975..1b902e4cb 100644 --- a/auth2-kbdint.c +++ b/auth2-kbdint.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2-kbdint.c,v 1.2 2002/05/31 11:35:15 markus Exp $"); #include "packet.h" #include "auth.h" diff --git a/auth2-none.c b/auth2-none.c index 2eb27a914..19cc2b1b7 100644 --- a/auth2-none.c +++ b/auth2-none.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2-none.c,v 1.8 2006/02/20 17:19:54 stevesk Exp $"); #include #include diff --git a/auth2-passwd.c b/auth2-passwd.c index 2321ef47b..41507af1d 100644 --- a/auth2-passwd.c +++ b/auth2-passwd.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2-passwd.c,v 1.5 2003/12/31 00:24:50 dtucker Exp $"); #include "xmalloc.h" #include "packet.h" diff --git a/auth2-pubkey.c b/auth2-pubkey.c index ea1367070..a59c37993 100644 --- a/auth2-pubkey.c +++ b/auth2-pubkey.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2-pubkey.c,v 1.10 2006/02/20 17:19:54 stevesk Exp $"); #include #include diff --git a/auth2.c b/auth2.c index d255242ed..b49cc79c7 100644 --- a/auth2.c +++ b/auth2.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2.c,v 1.107 2004/07/28 09:40:29 markus Exp $"); #include "ssh2.h" #include "xmalloc.h" diff --git a/authfd.c b/authfd.c index 06e6d4a4c..a3f22cfc7 100644 --- a/authfd.c +++ b/authfd.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfd.c,v 1.67 2006/02/20 16:36:14 stevesk Exp $"); #include #include diff --git a/authfile.c b/authfile.c index 0656262d0..d529c8340 100644 --- a/authfile.c +++ b/authfile.c @@ -36,7 +36,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfile.c,v 1.63 2006/03/13 10:26:52 dtucker Exp $"); #include #include diff --git a/bufaux.c b/bufaux.c index 106a3a0c7..19f6708f0 100644 --- a/bufaux.c +++ b/bufaux.c @@ -37,7 +37,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: bufaux.c,v 1.37 2005/11/05 05:01:15 djm Exp $"); #include #include "bufaux.h" diff --git a/buffer.c b/buffer.c index 487e08105..08682e0f1 100644 --- a/buffer.c +++ b/buffer.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: buffer.c,v 1.23 2005/03/14 11:46:56 markus Exp $"); #include "xmalloc.h" #include "buffer.h" diff --git a/canohost.c b/canohost.c index f15aecb62..4fafb0b82 100644 --- a/canohost.c +++ b/canohost.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: canohost.c,v 1.50 2006/03/14 00:15:39 djm Exp $"); #include diff --git a/channels.c b/channels.c index 7161b9413..30c6d3870 100644 --- a/channels.c +++ b/channels.c @@ -39,7 +39,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.235 2006/02/20 16:36:14 stevesk Exp $"); #include #include diff --git a/cipher-3des1.c b/cipher-3des1.c index f815e8ae5..53b5a2958 100644 --- a/cipher-3des1.c +++ b/cipher-3des1.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: cipher-3des1.c,v 1.2 2003/12/22 20:29:55 markus Exp $"); #include #include "xmalloc.h" diff --git a/cipher-acss.c b/cipher-acss.c index a95fa6747..90b51a4d1 100644 --- a/cipher-acss.c +++ b/cipher-acss.c @@ -17,8 +17,6 @@ #include "includes.h" #include -RCSID("$Id: cipher-acss.c,v 1.3 2005/07/17 07:04:47 djm Exp $"); - #if !defined(EVP_CTRL_SET_ACSS_MODE) && (OPENSSL_VERSION_NUMBER >= 0x00907000L) #include "acss.h" diff --git a/cipher-aes.c b/cipher-aes.c index 228ddb104..99e9eea92 100644 --- a/cipher-aes.c +++ b/cipher-aes.c @@ -28,7 +28,6 @@ #include "openbsd-compat/openssl-compat.h" #ifdef USE_BUILTIN_RIJNDAEL -RCSID("$OpenBSD: cipher-aes.c,v 1.2 2003/11/26 21:44:29 djm Exp $"); #include #include "rijndael.h" diff --git a/cipher-bf1.c b/cipher-bf1.c index 5af695c17..e7246650b 100644 --- a/cipher-bf1.c +++ b/cipher-bf1.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: cipher-bf1.c,v 1.1 2003/05/15 03:08:29 markus Exp $"); #include #include "xmalloc.h" diff --git a/cipher-ctr.c b/cipher-ctr.c index 8a98f3c42..9615f5aa6 100644 --- a/cipher-ctr.c +++ b/cipher-ctr.c @@ -14,7 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" -RCSID("$OpenBSD: cipher-ctr.c,v 1.6 2005/07/17 07:17:55 djm Exp $"); #include diff --git a/cipher.c b/cipher.c index 1434d5524..15397db03 100644 --- a/cipher.c +++ b/cipher.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: cipher.c,v 1.77 2005/07/16 01:35:24 djm Exp $"); #include "xmalloc.h" #include "log.h" diff --git a/cleanup.c b/cleanup.c index 11d1d4d9a..7b40ca781 100644 --- a/cleanup.c +++ b/cleanup.c @@ -14,7 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" -RCSID("$OpenBSD: cleanup.c,v 1.1 2003/09/23 20:17:11 markus Exp $"); #include "log.h" diff --git a/clientloop.c b/clientloop.c index 83706c297..6d58a5afb 100644 --- a/clientloop.c +++ b/clientloop.c @@ -59,7 +59,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.155 2006/02/22 00:04:44 stevesk Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/compat.c b/compat.c index 4086e853e..24d9a7f38 100644 --- a/compat.c +++ b/compat.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: compat.c,v 1.71 2005/03/01 10:09:52 djm Exp $"); #include "buffer.h" #include "packet.h" diff --git a/compress.c b/compress.c index 0d1c7e55e..6f8d6b775 100644 --- a/compress.c +++ b/compress.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: compress.c,v 1.21 2004/01/13 19:45:15 markus Exp $"); #include "log.h" #include "buffer.h" diff --git a/deattack.c b/deattack.c index 0cf1e1c54..3d48afc89 100644 --- a/deattack.c +++ b/deattack.c @@ -18,7 +18,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: deattack.c,v 1.20 2006/02/07 03:59:20 stevesk Exp $"); #include "deattack.h" #include "log.h" diff --git a/dh.c b/dh.c index 044d869fb..a30b704fb 100644 --- a/dh.c +++ b/dh.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: dh.c,v 1.31 2004/08/04 10:37:52 djm Exp $"); #include "xmalloc.h" diff --git a/dispatch.c b/dispatch.c index c5ff65031..3f96c726b 100644 --- a/dispatch.c +++ b/dispatch.c @@ -22,7 +22,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: dispatch.c,v 1.16 2003/04/08 20:21:28 itojun Exp $"); #include "ssh1.h" #include "ssh2.h" diff --git a/dns.c b/dns.c index a71dd9bff..e9270798d 100644 --- a/dns.c +++ b/dns.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dns.c,v 1.16 2005/10/17 14:13:35 stevesk Exp $ */ +/* $OpenBSD: dns.c,v 1.17 2006/03/19 18:51:18 deraadt Exp $ */ /* * Copyright (c) 2003 Wesley Griffin. All rights reserved. @@ -26,7 +26,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: dns.c,v 1.16 2005/10/17 14:13:35 stevesk Exp $"); #include diff --git a/entropy.c b/entropy.c index 91724273e..d60583b34 100644 --- a/entropy.c +++ b/entropy.c @@ -51,8 +51,6 @@ * XXX: we should tell the child how many bytes we need. */ -RCSID("$Id: entropy.c,v 1.53 2006/03/15 20:21:35 dtucker Exp $"); - #ifndef OPENSSL_PRNG_ONLY #define RANDOM_SEED_SIZE 48 static uid_t original_uid, original_euid; diff --git a/fatal.c b/fatal.c index ae1aaac6e..8eea85a03 100644 --- a/fatal.c +++ b/fatal.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: fatal.c,v 1.2 2003/09/23 20:17:11 markus Exp $"); #include "log.h" diff --git a/groupaccess.c b/groupaccess.c index f50879f83..2328bf453 100644 --- a/groupaccess.c +++ b/groupaccess.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: groupaccess.c,v 1.6 2003/04/08 20:21:28 itojun Exp $"); #include "groupaccess.h" #include "xmalloc.h" diff --git a/hostfile.c b/hostfile.c index 5cb55dd3c..85fbcf7ce 100644 --- a/hostfile.c +++ b/hostfile.c @@ -36,7 +36,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: hostfile.c,v 1.37 2006/02/07 03:47:05 stevesk Exp $"); #include diff --git a/includes.h b/includes.h index 65c34c496..363be3ac5 100644 --- a/includes.h +++ b/includes.h @@ -1,4 +1,4 @@ -/* $OpenBSD: includes.h,v 1.37 2006/02/22 00:04:44 stevesk Exp $ */ +/* $OpenBSD: includes.h,v 1.38 2006/03/19 18:51:18 deraadt Exp $ */ /* * Author: Tatu Ylonen @@ -16,9 +16,6 @@ #ifndef INCLUDES_H #define INCLUDES_H -#define RCSID(msg) \ -static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg } - #include "config.h" #define _GNU_SOURCE /* activate extra prototypes for glibc */ diff --git a/kex.c b/kex.c index 23d8d2923..ced56e668 100644 --- a/kex.c +++ b/kex.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kex.c,v 1.66 2006/03/07 09:07:40 djm Exp $"); #include diff --git a/kexdh.c b/kexdh.c index f79d8781d..f34214062 100644 --- a/kexdh.c +++ b/kexdh.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexdh.c,v 1.20 2005/11/04 05:15:59 djm Exp $"); #include diff --git a/kexdhc.c b/kexdhc.c index d8a2fa3b7..23abeb50d 100644 --- a/kexdhc.c +++ b/kexdhc.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexdhc.c,v 1.3 2005/11/04 05:15:59 djm Exp $"); #include "xmalloc.h" #include "key.h" diff --git a/kexdhs.c b/kexdhs.c index 26c8cdfd6..be815e46b 100644 --- a/kexdhs.c +++ b/kexdhs.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexdhs.c,v 1.3 2005/11/04 05:15:59 djm Exp $"); #include "xmalloc.h" #include "key.h" diff --git a/kexgex.c b/kexgex.c index 705484a47..b306821cc 100644 --- a/kexgex.c +++ b/kexgex.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexgex.c,v 1.24 2005/11/04 05:15:59 djm Exp $"); #include diff --git a/kexgexc.c b/kexgexc.c index a6ff8757d..50c5a32e5 100644 --- a/kexgexc.c +++ b/kexgexc.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexgexc.c,v 1.3 2005/11/04 05:15:59 djm Exp $"); #include "xmalloc.h" #include "key.h" diff --git a/kexgexs.c b/kexgexs.c index c48b27af9..e3d0eacc5 100644 --- a/kexgexs.c +++ b/kexgexs.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexgexs.c,v 1.2 2005/11/04 05:15:59 djm Exp $"); #include "xmalloc.h" #include "key.h" diff --git a/key.c b/key.c index 08c158b59..5cb54c13b 100644 --- a/key.c +++ b/key.c @@ -32,7 +32,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: key.c,v 1.58 2005/06/17 02:44:32 djm Exp $"); #include diff --git a/log.c b/log.c index 96ab24b04..58ba8591c 100644 --- a/log.c +++ b/log.c @@ -34,7 +34,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: log.c,v 1.29 2003/09/23 20:17:11 markus Exp $"); #include "log.h" #include "xmalloc.h" diff --git a/loginrec.c b/loginrec.c index 9f9eb69a7..c2498e1e3 100644 --- a/loginrec.c +++ b/loginrec.c @@ -168,8 +168,6 @@ # include #endif -RCSID("$Id: loginrec.c,v 1.72 2006/03/15 03:01:11 djm Exp $"); - /** ** prototypes for helper functions in this file **/ diff --git a/loginrec.h b/loginrec.h index 8e3390178..4fe24ac2a 100644 --- a/loginrec.h +++ b/loginrec.h @@ -35,8 +35,6 @@ #include #include -/* RCSID("$Id: loginrec.h,v 1.10 2005/06/19 00:19:44 djm Exp $"); */ - /** ** you should use the login_* calls to work around platform dependencies **/ diff --git a/logintest.c b/logintest.c index 95cce5a3a..1159274f8 100644 --- a/logintest.c +++ b/logintest.c @@ -43,8 +43,6 @@ #include "loginrec.h" -RCSID("$Id: logintest.c,v 1.11 2004/07/17 04:07:42 dtucker Exp $"); - extern char *__progname; #define PAUSE_BEFORE_LOGOUT 3 diff --git a/mac.c b/mac.c index 2bda5a1b9..f03100ac9 100644 --- a/mac.c +++ b/mac.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: mac.c,v 1.7 2005/06/17 02:44:32 djm Exp $"); #include diff --git a/match.c b/match.c index 51407b818..736047df1 100644 --- a/match.c +++ b/match.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: match.c,v 1.21 2006/02/22 00:04:44 stevesk Exp $"); #include diff --git a/md-sha256.c b/md-sha256.c index 064228a4a..8ea0ac433 100644 --- a/md-sha256.c +++ b/md-sha256.c @@ -31,8 +31,6 @@ # endif #endif -RCSID("$OpenBSD: md-sha256.c,v 1.1 2006/03/07 09:07:40 djm Exp $"); - const EVP_MD *evp_ssh_sha256(void); static int diff --git a/md5crypt.c b/md5crypt.c index 8f2523e62..253fdfdf2 100644 --- a/md5crypt.c +++ b/md5crypt.c @@ -13,8 +13,6 @@ #if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) #include -RCSID("$Id: md5crypt.c,v 1.9 2003/11/21 12:56:47 djm Exp $"); - /* 0 ... 63 => ascii - 64 */ static unsigned char itoa64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; diff --git a/misc.c b/misc.c index 662480e9e..66b762b5a 100644 --- a/misc.c +++ b/misc.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: misc.c,v 1.46 2006/03/13 10:14:29 dtucker Exp $"); #include #include diff --git a/monitor.c b/monitor.c index 502d54efa..e34d006d7 100644 --- a/monitor.c +++ b/monitor.c @@ -25,7 +25,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor.c,v 1.69 2006/03/07 09:07:40 djm Exp $"); #include #include diff --git a/monitor_fdpass.c b/monitor_fdpass.c index dd1a13984..dec90d18b 100644 --- a/monitor_fdpass.c +++ b/monitor_fdpass.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_fdpass.c,v 1.6 2004/08/13 02:51:48 djm Exp $"); #include diff --git a/monitor_mm.c b/monitor_mm.c index b0ec37cff..e8de71fea 100644 --- a/monitor_mm.c +++ b/monitor_mm.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_mm.c,v 1.9 2004/05/11 19:01:43 deraadt Exp $"); #ifdef HAVE_SYS_MMAN_H #include diff --git a/monitor_wrap.c b/monitor_wrap.c index 3b50753de..7536bf305 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c @@ -25,7 +25,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_wrap.c,v 1.40 2005/05/24 17:32:43 avsm Exp $"); #include #include diff --git a/msg.c b/msg.c index 3e4c2882c..662db4cdb 100644 --- a/msg.c +++ b/msg.c @@ -22,7 +22,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: msg.c,v 1.8 2005/05/24 17:32:43 avsm Exp $"); #include "buffer.h" #include "getput.h" diff --git a/nchan.c b/nchan.c index aee3f37b0..ca9a56b59 100644 --- a/nchan.c +++ b/nchan.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: nchan.c,v 1.51 2004/07/11 17:48:47 deraadt Exp $"); #include "ssh1.h" #include "ssh2.h" diff --git a/openbsd-compat/bsd-arc4random.c b/openbsd-compat/bsd-arc4random.c index 1eeb6953b..46e0a020f 100644 --- a/openbsd-compat/bsd-arc4random.c +++ b/openbsd-compat/bsd-arc4random.c @@ -17,8 +17,6 @@ #include "includes.h" #include "log.h" -RCSID("$Id: bsd-arc4random.c,v 1.10 2005/02/16 02:01:28 djm Exp $"); - #ifndef HAVE_ARC4RANDOM #include diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c index 5b7b94ae4..7509d2835 100644 --- a/openbsd-compat/bsd-closefrom.c +++ b/openbsd-compat/bsd-closefrom.c @@ -46,8 +46,6 @@ # define OPEN_MAX 256 #endif -RCSID("$Id: bsd-closefrom.c,v 1.2 2005/11/10 08:29:13 dtucker Exp $"); - #ifndef lint static const char sudorcsid[] = "$Sudo: closefrom.c,v 1.6 2004/06/01 20:51:56 millert Exp $"; #endif /* lint */ diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index 96be7fecd..8f3acee26 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c @@ -29,8 +29,6 @@ #include "includes.h" -RCSID("$Id: bsd-cygwin_util.c,v 1.15 2006/02/12 00:59:09 dtucker Exp $"); - #ifdef HAVE_CYGWIN #include diff --git a/openbsd-compat/bsd-getpeereid.c b/openbsd-compat/bsd-getpeereid.c index fe2edad71..d94489d1d 100644 --- a/openbsd-compat/bsd-getpeereid.c +++ b/openbsd-compat/bsd-getpeereid.c @@ -16,8 +16,6 @@ #include "includes.h" -RCSID("$Id: bsd-getpeereid.c,v 1.3 2004/02/17 05:49:55 djm Exp $"); - #if !defined(HAVE_GETPEEREID) #if defined(SO_PEERCRED) diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 00482616d..d2d9ad771 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -21,8 +21,6 @@ #include "xmalloc.h" -RCSID("$Id: bsd-misc.c,v 1.29 2006/03/15 03:42:57 djm Exp $"); - #ifndef HAVE___PROGNAME char *__progname; #endif diff --git a/openbsd-compat/bsd-nextstep.c b/openbsd-compat/bsd-nextstep.c index bd35a3afc..8195af88a 100644 --- a/openbsd-compat/bsd-nextstep.c +++ b/openbsd-compat/bsd-nextstep.c @@ -24,8 +24,6 @@ #include "includes.h" -RCSID("$Id: bsd-nextstep.c,v 1.6 2003/06/01 03:23:57 mouring Exp $"); - #ifdef HAVE_NEXT #include #include diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index 571c61fc0..c30cd1223 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -89,8 +89,6 @@ #include "includes.h" -RCSID("$Id: bsd-snprintf.c,v 1.12 2006/03/18 13:07:07 dtucker Exp $"); - #if defined(BROKEN_SNPRINTF) /* For those with broken snprintf() */ # undef HAVE_SNPRINTF # undef HAVE_VSNPRINTF diff --git a/openbsd-compat/bsd-waitpid.c b/openbsd-compat/bsd-waitpid.c index 93c9ec35e..40e6ffaa8 100644 --- a/openbsd-compat/bsd-waitpid.c +++ b/openbsd-compat/bsd-waitpid.c @@ -24,8 +24,6 @@ #include "includes.h" -RCSID("$Id: bsd-waitpid.c,v 1.5 2003/06/01 03:23:57 mouring Exp $"); - #ifndef HAVE_WAITPID #include #include diff --git a/openbsd-compat/fake-rfc2553.c b/openbsd-compat/fake-rfc2553.c index 0186b5300..aae016bf7 100644 --- a/openbsd-compat/fake-rfc2553.c +++ b/openbsd-compat/fake-rfc2553.c @@ -37,8 +37,6 @@ #include "includes.h" -RCSID("$Id: fake-rfc2553.c,v 1.5 2003/09/22 02:08:23 dtucker Exp $"); - #ifndef HAVE_GETNAMEINFO int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags) diff --git a/packet.c b/packet.c index ca6861e55..a1e7d32f6 100644 --- a/packet.c +++ b/packet.c @@ -37,7 +37,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: packet.c,v 1.122 2006/03/13 08:33:00 dtucker Exp $"); #include "openbsd-compat/sys-queue.h" #include diff --git a/progressmeter.c b/progressmeter.c index 5ae02493b..26b34a3e9 100644 --- a/progressmeter.c +++ b/progressmeter.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: progressmeter.c,v 1.26 2006/02/20 17:02:44 stevesk Exp $"); #include diff --git a/readconf.c b/readconf.c index 392fc52c2..1112d0d86 100644 --- a/readconf.c +++ b/readconf.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: readconf.c,v 1.148 2006/02/22 00:04:44 stevesk Exp $"); #include #include diff --git a/readpass.c b/readpass.c index 811cfa231..4236c43c7 100644 --- a/readpass.c +++ b/readpass.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: readpass.c,v 1.35 2006/02/10 01:44:26 stevesk Exp $"); #include #include diff --git a/rsa.c b/rsa.c index 66561a421..507b73c9c 100644 --- a/rsa.c +++ b/rsa.c @@ -60,7 +60,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: rsa.c,v 1.24 2001/12/27 18:22:16 markus Exp $"); #include "rsa.h" #include "log.h" diff --git a/scard.c b/scard.c index b3d25058a..7cffc2d4e 100644 --- a/scard.c +++ b/scard.c @@ -24,7 +24,6 @@ #include "includes.h" #if defined(SMARTCARD) && defined(USE_SECTOK) -RCSID("$OpenBSD: scard.c,v 1.29 2004/05/08 00:21:31 djm Exp $"); #include #include diff --git a/scp.c b/scp.c index af9317645..43fd50c9e 100644 --- a/scp.c +++ b/scp.c @@ -71,7 +71,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.135 2006/02/22 00:04:44 stevesk Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/servconf.c b/servconf.c index 81953bb80..2ae93d4c3 100644 --- a/servconf.c +++ b/servconf.c @@ -10,7 +10,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: servconf.c,v 1.146 2005/12/08 18:34:11 reyk Exp $"); #include "ssh.h" #include "log.h" diff --git a/serverloop.c b/serverloop.c index f4fb6b7b5..2ad0bcf2b 100644 --- a/serverloop.c +++ b/serverloop.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: serverloop.c,v 1.128 2006/03/04 04:12:58 djm Exp $"); #include #include diff --git a/session.c b/session.c index 8eb1a03e5..6efaf659d 100644 --- a/session.c +++ b/session.c @@ -33,7 +33,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.197 2006/02/28 01:10:21 djm Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/sftp-client.c b/sftp-client.c index 6637feca4..c34f919a4 100644 --- a/sftp-client.c +++ b/sftp-client.c @@ -20,7 +20,6 @@ /* XXX: copy between two remote sites */ #include "includes.h" -RCSID("$OpenBSD: sftp-client.c,v 1.60 2006/02/20 17:19:54 stevesk Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/sftp-common.c b/sftp-common.c index aa0757561..4222f58d6 100644 --- a/sftp-common.c +++ b/sftp-common.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sftp-common.c,v 1.11 2006/02/20 17:19:54 stevesk Exp $"); #include #include diff --git a/sftp-glob.c b/sftp-glob.c index baa84aa71..cee44fc4c 100644 --- a/sftp-glob.c +++ b/sftp-glob.c @@ -15,7 +15,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sftp-glob.c,v 1.17 2006/02/20 17:19:54 stevesk Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/sftp-server.c b/sftp-server.c index 30bd1b0ee..cf3458120 100644 --- a/sftp-server.c +++ b/sftp-server.c @@ -14,7 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" -RCSID("$OpenBSD: sftp-server.c,v 1.52 2006/02/20 17:19:54 stevesk Exp $"); #include #include diff --git a/sftp.c b/sftp.c index c4f027846..d676a3771 100644 --- a/sftp.c +++ b/sftp.c @@ -15,7 +15,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sftp.c,v 1.75 2006/02/20 17:19:54 stevesk Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/ssh-add.c b/ssh-add.c index 59933012d..4c5cc5727 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-add.c,v 1.76 2006/03/13 10:26:52 dtucker Exp $"); #include #include diff --git a/ssh-agent.c b/ssh-agent.c index b09ce86f2..17914410c 100644 --- a/ssh-agent.c +++ b/ssh-agent.c @@ -34,7 +34,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-agent.c,v 1.129 2006/02/20 17:02:44 stevesk Exp $"); #include #include diff --git a/ssh-dss.c b/ssh-dss.c index 381b7dedb..8250266fa 100644 --- a/ssh-dss.c +++ b/ssh-dss.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-dss.c,v 1.19 2003/11/10 16:23:41 jakob Exp $"); #include #include diff --git a/ssh-keygen.c b/ssh-keygen.c index bea4ed59b..c527252b9 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.137 2006/03/13 08:43:16 dtucker Exp $"); #include #include diff --git a/ssh-keyscan.c b/ssh-keyscan.c index f05c4697c..fee6406be 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -7,7 +7,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.60 2006/03/07 09:07:40 djm Exp $"); #include "openbsd-compat/sys-queue.h" #include diff --git a/ssh-keysign.c b/ssh-keysign.c index aa0260bf8..a96babfa5 100644 --- a/ssh-keysign.c +++ b/ssh-keysign.c @@ -22,7 +22,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: ssh-keysign.c,v 1.20 2006/02/08 12:15:27 stevesk Exp $"); #ifdef HAVE_PATHS_H #include diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c index d6e631317..bdf73ec48 100644 --- a/ssh-rand-helper.c +++ b/ssh-rand-helper.c @@ -50,8 +50,6 @@ #include "pathnames.h" #include "log.h" -RCSID("$Id: ssh-rand-helper.c,v 1.27 2006/03/15 03:02:36 djm Exp $"); - /* Number of bytes we write out */ #define OUTPUT_SEED_SIZE 48 diff --git a/ssh-rsa.c b/ssh-rsa.c index eb422d07e..48607c4fb 100644 --- a/ssh-rsa.c +++ b/ssh-rsa.c @@ -14,7 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" -RCSID("$OpenBSD: ssh-rsa.c,v 1.32 2005/06/17 02:44:33 djm Exp $"); #include #include diff --git a/ssh.c b/ssh.c index 911231a6c..9402491e3 100644 --- a/ssh.c +++ b/ssh.c @@ -40,7 +40,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.266 2006/03/12 04:23:07 djm Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/sshconnect.c b/sshconnect.c index 340270731..53b5200ff 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -13,7 +13,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect.c,v 1.176 2006/02/22 00:04:45 stevesk Exp $"); #include #include diff --git a/sshconnect1.c b/sshconnect1.c index 440d7c5bd..a39441120 100644 --- a/sshconnect1.c +++ b/sshconnect1.c @@ -13,7 +13,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect1.c,v 1.62 2005/10/30 08:52:18 djm Exp $"); #include #include diff --git a/sshconnect2.c b/sshconnect2.c index 2467d235c..b7aa96e39 100644 --- a/sshconnect2.c +++ b/sshconnect2.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect2.c,v 1.147 2006/03/07 09:07:40 djm Exp $"); #include #include diff --git a/sshd.c b/sshd.c index aef4db109..e6b1f5496 100644 --- a/sshd.c +++ b/sshd.c @@ -42,7 +42,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.325 2006/03/13 08:16:00 djm Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/sshlogin.c b/sshlogin.c index 15eb916d1..718c9c412 100644 --- a/sshlogin.c +++ b/sshlogin.c @@ -39,7 +39,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshlogin.c,v 1.13 2004/08/12 09:18:24 djm Exp $"); #include "loginrec.h" #include "log.h" diff --git a/sshpty.c b/sshpty.c index 7241580a8..2e42aee11 100644 --- a/sshpty.c +++ b/sshpty.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshpty.c,v 1.16 2006/02/20 17:19:54 stevesk Exp $"); #include #include diff --git a/sshtty.c b/sshtty.c index 844a5c063..528177b4b 100644 --- a/sshtty.c +++ b/sshtty.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshtty.c,v 1.8 2006/02/07 01:52:50 stevesk Exp $"); #include diff --git a/ttymodes.c b/ttymodes.c index 7f621e30e..2c95938d9 100644 --- a/ttymodes.c +++ b/ttymodes.c @@ -43,7 +43,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ttymodes.c,v 1.20 2006/02/07 01:42:00 stevesk Exp $"); #include diff --git a/uidswap.c b/uidswap.c index aab7064eb..ca0894806 100644 --- a/uidswap.c +++ b/uidswap.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: uidswap.c,v 1.24 2003/05/29 16:58:45 deraadt Exp $"); #include "log.h" #include "uidswap.h" diff --git a/uuencode.c b/uuencode.c index 0a7c8d16a..314eb92f3 100644 --- a/uuencode.c +++ b/uuencode.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: uuencode.c,v 1.17 2003/11/10 16:23:41 jakob Exp $"); #include "xmalloc.h" #include "uuencode.h" diff --git a/xmalloc.c b/xmalloc.c index 99c6ac330..64e439853 100644 --- a/xmalloc.c +++ b/xmalloc.c @@ -13,7 +13,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: xmalloc.c,v 1.16 2001/07/23 18:21:46 stevesk Exp $"); #include "xmalloc.h" #include "log.h" -- cgit v1.2.3 From 62da44f0644f5d1cc7fa3b6b967482b5d2f15aa2 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 24 Jul 2006 15:08:35 +1000 Subject: - (djm) [openbsd-compat/basename.c openbsd-compat/bsd-closefrom.c] [openbsd-compat/bsd-cray.c openbsd-compat/bsd-openpty.c] [openbsd-compat/bsd-snprintf.c openbsd-compat/fake-rfc2553.c] [openbsd-compat/port-aix.c openbsd-compat/port-irix.c] [openbsd-compat/rresvport.c] These look to need string.h and/or unistd.h (based on a grep for function names) --- ChangeLog | 11 +++++++++-- openbsd-compat/basename.c | 1 + openbsd-compat/bsd-closefrom.c | 2 ++ openbsd-compat/bsd-cray.c | 4 +++- openbsd-compat/bsd-openpty.c | 2 ++ openbsd-compat/bsd-snprintf.c | 2 ++ openbsd-compat/fake-rfc2553.c | 1 + openbsd-compat/port-aix.c | 2 ++ openbsd-compat/port-irix.c | 3 +++ openbsd-compat/rresvport.c | 1 + 10 files changed, 26 insertions(+), 3 deletions(-) (limited to 'openbsd-compat/bsd-snprintf.c') diff --git a/ChangeLog b/ChangeLog index aa3d0ae9b..9e9ecfa6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -122,7 +122,14 @@ - (djm) [session.c] fix compile error with -Werror -Wall: 'path' is only used in do_setup_env() if HAVE_LOGIN_CAP is not defined - + - (djm) [openbsd-compat/basename.c openbsd-compat/bsd-closefrom.c] + [openbsd-compat/bsd-cray.c openbsd-compat/bsd-openpty.c] + [openbsd-compat/bsd-snprintf.c openbsd-compat/fake-rfc2553.c] + [openbsd-compat/port-aix.c openbsd-compat/port-irix.c] + [openbsd-compat/rresvport.c] + These look to need string.h and/or unistd.h (based on a grep for function + names) + 20060713 - (dtucker) [auth-krb5.c auth-pam.c] Still more errno.h @@ -5040,4 +5047,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4433 2006/07/24 05:03:06 djm Exp $ +$Id: ChangeLog,v 1.4434 2006/07/24 05:08:35 djm Exp $ diff --git a/openbsd-compat/basename.c b/openbsd-compat/basename.c index ad040e139..4b10cb84b 100644 --- a/openbsd-compat/basename.c +++ b/openbsd-compat/basename.c @@ -20,6 +20,7 @@ #include "includes.h" #ifndef HAVE_BASENAME +#include char * basename(const char *path) diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c index 7509d2835..3f17302d1 100644 --- a/openbsd-compat/bsd-closefrom.c +++ b/openbsd-compat/bsd-closefrom.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #ifdef HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c index d1f1c059c..8093f6d54 100644 --- a/openbsd-compat/bsd-cray.c +++ b/openbsd-compat/bsd-cray.c @@ -1,5 +1,5 @@ /* - * $Id: bsd-cray.c,v 1.14 2005/02/02 06:10:11 dtucker Exp $ + * $Id: bsd-cray.c,v 1.15 2006/07/24 05:08:36 djm Exp $ * * bsd-cray.c * @@ -53,6 +53,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/openbsd-compat/bsd-openpty.c b/openbsd-compat/bsd-openpty.c index 0b77a1da9..a2f2fda60 100644 --- a/openbsd-compat/bsd-openpty.c +++ b/openbsd-compat/bsd-openpty.c @@ -57,6 +57,8 @@ #endif #include +#include +#include #ifndef O_NOCTTY #define O_NOCTTY 0 diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index c30cd1223..9fdf4d3f0 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -108,6 +108,8 @@ #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) +#include + #ifdef HAVE_LONG_DOUBLE # define LDOUBLE long double #else diff --git a/openbsd-compat/fake-rfc2553.c b/openbsd-compat/fake-rfc2553.c index aae016bf7..08a7cb66c 100644 --- a/openbsd-compat/fake-rfc2553.c +++ b/openbsd-compat/fake-rfc2553.c @@ -36,6 +36,7 @@ */ #include "includes.h" +#include #ifndef HAVE_GETNAMEINFO int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index 6fd593aad..2d56e7e4a 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c @@ -38,6 +38,8 @@ # include #endif #include +#include +#include #include #include "port-aix.h" diff --git a/openbsd-compat/port-irix.c b/openbsd-compat/port-irix.c index aa6db1cf8..eaa91a4b5 100644 --- a/openbsd-compat/port-irix.c +++ b/openbsd-compat/port-irix.c @@ -29,6 +29,9 @@ defined(WITH_IRIX_JOBS) || \ defined(WITH_IRIX_ARRAY) +#include +#include + #ifdef WITH_IRIX_PROJECT # include #endif /* WITH_IRIX_PROJECT */ diff --git a/openbsd-compat/rresvport.c b/openbsd-compat/rresvport.c index fc029f46f..c10391872 100644 --- a/openbsd-compat/rresvport.c +++ b/openbsd-compat/rresvport.c @@ -36,6 +36,7 @@ #ifndef HAVE_RRESVPORT_AF #include +#include #if 0 int -- cgit v1.2.3 From f78fb54412e34c2647c1bc9f895af00620f42730 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 6 Aug 2006 21:25:24 +1000 Subject: - (dtucker) [openbsd-compat/{bsd-asprintf.c,bsd-openpty.c,bsd-snprintf.c, glob.c}] Include stdlib.h for malloc and friends in compat code. --- ChangeLog | 4 +++- openbsd-compat/bsd-asprintf.c | 1 + openbsd-compat/bsd-openpty.c | 2 ++ openbsd-compat/bsd-snprintf.c | 2 ++ openbsd-compat/glob.c | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) (limited to 'openbsd-compat/bsd-snprintf.c') diff --git a/ChangeLog b/ChangeLog index 60a1fd753..1efc7ba36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2006086 - (dtucker) [defines.h] With the includes.h changes we no longer get the name clash on "YES" so we can remove the workaround for it. + - (dtucker) [openbsd-compat/{bsd-asprintf.c,bsd-openpty.c,bsd-snprintf.c, + glob.c}] Include stdlib.h for malloc and friends in compat code. 20060805 - (djm) OpenBSD CVS Sync @@ -5198,4 +5200,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4475 2006/08/06 11:23:27 dtucker Exp $ +$Id: ChangeLog,v 1.4476 2006/08/06 11:25:24 dtucker Exp $ diff --git a/openbsd-compat/bsd-asprintf.c b/openbsd-compat/bsd-asprintf.c index 1178296f8..67480139e 100644 --- a/openbsd-compat/bsd-asprintf.c +++ b/openbsd-compat/bsd-asprintf.c @@ -23,6 +23,7 @@ #include #include +#include #ifndef VA_COPY # ifdef HAVE_VA_COPY diff --git a/openbsd-compat/bsd-openpty.c b/openbsd-compat/bsd-openpty.c index a2f2fda60..c0cde6b1f 100644 --- a/openbsd-compat/bsd-openpty.c +++ b/openbsd-compat/bsd-openpty.c @@ -37,6 +37,8 @@ #include +#include + #ifdef HAVE_SYS_STAT_H # include #endif diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index 9fdf4d3f0..47cbcff67 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -108,6 +108,8 @@ #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) +#include +#include #include #ifdef HAVE_LONG_DOUBLE diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c index 907235353..ec16b1108 100644 --- a/openbsd-compat/glob.c +++ b/openbsd-compat/glob.c @@ -37,10 +37,12 @@ #include #include + #include #include #include #include +#include #include #include -- cgit v1.2.3 From 08432d54faf63a2f5f9c264ac8ff6aa343ebeabc Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 9 Sep 2006 15:59:43 +1000 Subject: - (dtucker) [openbsd-compat/bsd-snprintf.c] Add stdarg.h. --- ChangeLog | 5 ++++- openbsd-compat/bsd-snprintf.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'openbsd-compat/bsd-snprintf.c') diff --git a/ChangeLog b/ChangeLog index 818cb9774..ead33c85b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20060909 + - (dtucker) [openbsd-compat/bsd-snprintf.c] Add stdarg.h. + 20060908 - (dtucker) [auth-sia.c] Add includes required for build on Tru64. Patch from Chris Adams. @@ -5415,4 +5418,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4537 2006/09/08 15:05:21 dtucker Exp $ +$Id: ChangeLog,v 1.4538 2006/09/09 05:59:43 dtucker Exp $ diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index 47cbcff67..04651e1d4 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -109,6 +109,7 @@ #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) #include +#include #include #include -- cgit v1.2.3 From 742cc1c19420db71275d3e8ef9fb86d96a463a4b Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 14 Jan 2007 21:20:30 +1100 Subject: - (djm) [openbsd-compat/bsd-snprintf.c] Fix integer overflow in return value of snprintf replacement, similar to bugs in various libc implementations. This overflow is not exploitable in OpenSSH. While I'm fiddling with it, make it a fair bit faster by inlining the append-char routine; ok dtucker@ --- ChangeLog | 7 +- openbsd-compat/bsd-snprintf.c | 164 ++++++++++++++++++++++++++---------------- 2 files changed, 107 insertions(+), 64 deletions(-) (limited to 'openbsd-compat/bsd-snprintf.c') diff --git a/ChangeLog b/ChangeLog index bad97ecf0..7682c5c54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 20070114 - (dtucker) [ssh-keygen.c] av -> argv to match earlier sync. + - (djm) [openbsd-compat/bsd-snprintf.c] Fix integer overflow in return + value of snprintf replacement, similar to bugs in various libc + implementations. This overflow is not exploitable in OpenSSH. + While I'm fiddling with it, make it a fair bit faster by inlining the + append-char routine; ok dtucker@ 20070105 - (djm) OpenBSD CVS Sync @@ -2664,4 +2669,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4604 2007/01/13 23:26:25 dtucker Exp $ +$Id: ChangeLog,v 1.4605 2007/01/14 10:20:30 djm Exp $ diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index 04651e1d4..cefb1d1ad 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -85,6 +85,11 @@ * * Move #endif to make sure VA_COPY, LDOUBLE, etc are defined even * if the C library has some snprintf functions already. + * + * Damien Miller (djm@mindrot.org) Jan 2007 + * Fix integer overflows in return value. + * Make formatting quite a bit faster by inlining dopr_outch() + * **************************************************************/ #include "includes.h" @@ -112,6 +117,8 @@ #include #include #include +#include +#include #ifdef HAVE_LONG_DOUBLE # define LDOUBLE long double @@ -159,17 +166,27 @@ # define MAX(p,q) (((p) >= (q)) ? (p) : (q)) #endif -static size_t dopr(char *buffer, size_t maxlen, const char *format, - va_list args_in); -static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, - char *value, int flags, int min, int max); -static void fmtint(char *buffer, size_t *currlen, size_t maxlen, - LLONG value, int base, int min, int max, int flags); -static void fmtfp(char *buffer, size_t *currlen, size_t maxlen, - LDOUBLE fvalue, int min, int max, int flags); -static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); - -static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args_in) +#define DOPR_OUTCH(buf, pos, buflen, thechar) \ + do { \ + if (++pos >= INT_MAX) { \ + errno = ERANGE; \ + return -1; \ + if (pos < buflen) \ + buf[pos] = thechar; \ + } \ + } while (0) + +static int dopr(char *buffer, size_t maxlen, const char *format, + va_list args_in); +static int fmtstr(char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max); +static int fmtint(char *buffer, size_t *currlen, size_t maxlen, + LLONG value, int base, int min, int max, int flags); +static int fmtfp(char *buffer, size_t *currlen, size_t maxlen, + LDOUBLE fvalue, int min, int max, int flags); + +static int +dopr(char *buffer, size_t maxlen, const char *format, va_list args_in) { char ch; LLONG value; @@ -198,8 +215,8 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args case DP_S_DEFAULT: if (ch == '%') state = DP_S_FLAGS; - else - dopr_outch (buffer, &currlen, maxlen, ch); + else + DOPR_OUTCH(buffer, currlen, maxlen, ch); ch = *format++; break; case DP_S_FLAGS: @@ -298,7 +315,9 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args value = va_arg (args, LLONG); else value = va_arg (args, int); - fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); + if (fmtint(buffer, &currlen, maxlen, + value, 10, min, max, flags) == -1) + return -1; break; case 'o': flags |= DP_F_UNSIGNED; @@ -310,7 +329,9 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args value = (long)va_arg (args, unsigned LLONG); else value = (long)va_arg (args, unsigned int); - fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags); + if (fmtint(buffer, &currlen, maxlen, value, + 8, min, max, flags) == -1) + return -1; break; case 'u': flags |= DP_F_UNSIGNED; @@ -322,7 +343,9 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args value = (LLONG)va_arg (args, unsigned LLONG); else value = (long)va_arg (args, unsigned int); - fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); + if (fmtint(buffer, &currlen, maxlen, value, + 10, min, max, flags) == -1) + return -1; break; case 'X': flags |= DP_F_UP; @@ -336,15 +359,18 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args value = (LLONG)va_arg (args, unsigned LLONG); else value = (long)va_arg (args, unsigned int); - fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags); + if (fmtint(buffer, &currlen, maxlen, value, + 16, min, max, flags) == -1) + return -1; break; case 'f': if (cflags == DP_C_LDOUBLE) fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); - /* um, floating point? */ - fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); + if (fmtfp(buffer, &currlen, maxlen, fvalue, + min, max, flags) == -1) + return -1; break; case 'E': flags |= DP_F_UP; @@ -353,7 +379,9 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); - fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); + if (fmtfp(buffer, &currlen, maxlen, fvalue, + min, max, flags) == -1) + return -1; break; case 'G': flags |= DP_F_UP; @@ -362,10 +390,13 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); - fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); + if (fmtfp(buffer, &currlen, maxlen, fvalue, + min, max, flags) == -1) + return -1; break; case 'c': - dopr_outch (buffer, &currlen, maxlen, va_arg (args, int)); + DOPR_OUTCH(buffer, currlen, maxlen, + va_arg (args, int)); break; case 's': strvalue = va_arg (args, char *); @@ -374,11 +405,15 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args max = strlen(strvalue); } if (min > 0 && max >= 0 && min > max) max = min; - fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max); + if (fmtstr(buffer, &currlen, maxlen, + strvalue, flags, min, max) == -1) + return -1; break; case 'p': strvalue = va_arg (args, void *); - fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags); + if (fmtint(buffer, &currlen, maxlen, + (long) strvalue, 16, min, max, flags) == -1) + return -1; break; case 'n': if (cflags == DP_C_SHORT) { @@ -400,7 +435,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args } break; case '%': - dopr_outch (buffer, &currlen, maxlen, ch); + DOPR_OUTCH(buffer, currlen, maxlen, ch); break; case 'w': /* not supported yet, treat as next char */ @@ -429,11 +464,12 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args buffer[maxlen - 1] = '\0'; } - return currlen; + return currlen < INT_MAX ? (int)currlen : -1; } -static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, - char *value, int flags, int min, int max) +static int +fmtstr(char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max) { int padlen, strln; /* amount to pad */ int cnt = 0; @@ -453,24 +489,26 @@ static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, padlen = -padlen; /* Left Justify */ while ((padlen > 0) && (cnt < max)) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); --padlen; ++cnt; } while (*value && (cnt < max)) { - dopr_outch (buffer, currlen, maxlen, *value++); + DOPR_OUTCH(buffer, *currlen, maxlen, *value++); ++cnt; } while ((padlen < 0) && (cnt < max)) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); ++padlen; ++cnt; } + return 0; } /* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ -static void fmtint(char *buffer, size_t *currlen, size_t maxlen, +static int +fmtint(char *buffer, size_t *currlen, size_t maxlen, LLONG value, int base, int min, int max, int flags) { int signvalue = 0; @@ -527,31 +565,32 @@ static void fmtint(char *buffer, size_t *currlen, size_t maxlen, /* Spaces */ while (spadlen > 0) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); --spadlen; } /* Sign */ if (signvalue) - dopr_outch (buffer, currlen, maxlen, signvalue); + DOPR_OUTCH(buffer, *currlen, maxlen, signvalue); /* Zeros */ if (zpadlen > 0) { while (zpadlen > 0) { - dopr_outch (buffer, currlen, maxlen, '0'); + DOPR_OUTCH(buffer, *currlen, maxlen, '0'); --zpadlen; } } /* Digits */ while (place > 0) - dopr_outch (buffer, currlen, maxlen, convert[--place]); + DOPR_OUTCH(buffer, *currlen, maxlen, convert[--place]); /* Left Justified spaces */ while (spadlen < 0) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); ++spadlen; } + return 0; } static LDOUBLE abs_val(LDOUBLE value) @@ -564,13 +603,13 @@ static LDOUBLE abs_val(LDOUBLE value) return result; } -static LDOUBLE POW10(int exp) +static LDOUBLE POW10(int val) { LDOUBLE result = 1; - while (exp) { + while (val) { result *= 10; - exp--; + val--; } return result; @@ -604,7 +643,10 @@ static double my_modf(double x0, double *iptr) } if (i == 100) { - /* yikes! the number is beyond what we can handle. What do we do? */ + /* + * yikes! the number is beyond what we can handle. + * What do we do? + */ (*iptr) = 0; return 0; } @@ -623,8 +665,9 @@ static double my_modf(double x0, double *iptr) } -static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, - LDOUBLE fvalue, int min, int max, int flags) +static int +fmtfp (char *buffer, size_t *currlen, size_t maxlen, + LDOUBLE fvalue, int min, int max, int flags) { int signvalue = 0; double ufvalue; @@ -729,24 +772,24 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, if ((flags & DP_F_ZERO) && (padlen > 0)) { if (signvalue) { - dopr_outch (buffer, currlen, maxlen, signvalue); + DOPR_OUTCH(buffer, *currlen, maxlen, signvalue); --padlen; signvalue = 0; } while (padlen > 0) { - dopr_outch (buffer, currlen, maxlen, '0'); + DOPR_OUTCH(buffer, *currlen, maxlen, '0'); --padlen; } } while (padlen > 0) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); --padlen; } if (signvalue) - dopr_outch (buffer, currlen, maxlen, signvalue); + DOPR_OUTCH(buffer, *currlen, maxlen, signvalue); while (iplace > 0) - dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]); + DOPR_OUTCH(buffer, *currlen, maxlen, iconvert[--iplace]); #ifdef DEBUG_SNPRINTF printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen); @@ -757,41 +800,37 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, * char to print out. */ if (max > 0) { - dopr_outch (buffer, currlen, maxlen, '.'); + DOPR_OUTCH(buffer, *currlen, maxlen, '.'); while (zpadlen > 0) { - dopr_outch (buffer, currlen, maxlen, '0'); + DOPR_OUTCH(buffer, *currlen, maxlen, '0'); --zpadlen; } while (fplace > 0) - dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]); + DOPR_OUTCH(buffer, *currlen, maxlen, + fconvert[--fplace]); } while (padlen < 0) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); ++padlen; } -} - -static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) -{ - if (*currlen < maxlen) { - buffer[(*currlen)] = c; - } - (*currlen)++; + return 0; } #endif /* !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) */ #if !defined(HAVE_VSNPRINTF) -int vsnprintf (char *str, size_t count, const char *fmt, va_list args) +static int +vsnprintf (char *str, size_t count, const char *fmt, va_list args) { return dopr(str, count, fmt, args); } #endif #if !defined(HAVE_SNPRINTF) -int snprintf(char *str, size_t count, SNPRINTF_CONST char *fmt, ...) +static int +snprintf(char *str, size_t count, const char *fmt, ...) { size_t ret; va_list ap; @@ -802,4 +841,3 @@ int snprintf(char *str, size_t count, SNPRINTF_CONST char *fmt, ...) return ret; } #endif - -- cgit v1.2.3 From 07877ca68066593473fbe29dd309dcdc61b6d629 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 24 Jan 2007 00:07:29 +1100 Subject: - (dtucker) [openbsd-compat/bsd-snprintf.c] Static declarations for public library interfaces aren't very helpful. Fix up the DOPR_OUTCH macro so it works properly and modify its callers so that they don't pre or post decrement arguments that are conditionally evaluated. While there, put SNPRINTF_CONST back as it prevents build failures in some configurations. ok djm@ (for most of it) --- ChangeLog | 10 +++++++++- openbsd-compat/bsd-snprintf.c | 33 ++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 14 deletions(-) (limited to 'openbsd-compat/bsd-snprintf.c') diff --git a/ChangeLog b/ChangeLog index dd8bd3561..7dd2e4ab8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +20070123 + - (dtucker) [openbsd-compat/bsd-snprintf.c] Static declarations for public + library interfaces aren't very helpful. Fix up the DOPR_OUTCH macro + so it works properly and modify its callers so that they don't pre or + post decrement arguments that are conditionally evaluated. While there, + put SNPRINTF_CONST back as it prevents build failures in some + configurations. ok djm@ (for most of it) + 20070122 - (djm) [ssh-rand-helper.8] manpage nits; from dleonard AT vintela.com (bz#1529) @@ -2678,4 +2686,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4607 2007/01/22 01:44:53 djm Exp $ +$Id: ChangeLog,v 1.4608 2007/01/23 13:07:29 dtucker Exp $ diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index cefb1d1ad..41d2be238 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -168,12 +168,13 @@ #define DOPR_OUTCH(buf, pos, buflen, thechar) \ do { \ - if (++pos >= INT_MAX) { \ + if (pos + 1 >= INT_MAX) { \ errno = ERANGE; \ return -1; \ + } \ if (pos < buflen) \ buf[pos] = thechar; \ - } \ + (pos)++; \ } while (0) static int dopr(char *buffer, size_t maxlen, const char *format, @@ -494,7 +495,8 @@ fmtstr(char *buffer, size_t *currlen, size_t maxlen, ++cnt; } while (*value && (cnt < max)) { - DOPR_OUTCH(buffer, *currlen, maxlen, *value++); + DOPR_OUTCH(buffer, *currlen, maxlen, *value); + *value++; ++cnt; } while ((padlen < 0) && (cnt < max)) { @@ -582,8 +584,10 @@ fmtint(char *buffer, size_t *currlen, size_t maxlen, } /* Digits */ - while (place > 0) - DOPR_OUTCH(buffer, *currlen, maxlen, convert[--place]); + while (place > 0) { + --place; + DOPR_OUTCH(buffer, *currlen, maxlen, convert[place]); + } /* Left Justified spaces */ while (spadlen < 0) { @@ -788,8 +792,10 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, if (signvalue) DOPR_OUTCH(buffer, *currlen, maxlen, signvalue); - while (iplace > 0) - DOPR_OUTCH(buffer, *currlen, maxlen, iconvert[--iplace]); + while (iplace > 0) { + --iplace; + DOPR_OUTCH(buffer, *currlen, maxlen, iconvert[iplace]); + } #ifdef DEBUG_SNPRINTF printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen); @@ -807,9 +813,10 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, --zpadlen; } - while (fplace > 0) - DOPR_OUTCH(buffer, *currlen, maxlen, - fconvert[--fplace]); + while (fplace > 0) { + --fplace; + DOPR_OUTCH(buffer, *currlen, maxlen, fconvert[fplace]); + } } while (padlen < 0) { @@ -821,7 +828,7 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, #endif /* !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) */ #if !defined(HAVE_VSNPRINTF) -static int +int vsnprintf (char *str, size_t count, const char *fmt, va_list args) { return dopr(str, count, fmt, args); @@ -829,8 +836,8 @@ vsnprintf (char *str, size_t count, const char *fmt, va_list args) #endif #if !defined(HAVE_SNPRINTF) -static int -snprintf(char *str, size_t count, const char *fmt, ...) +int +snprintf(char *str, size_t count, SNPRINTF_CONST char *fmt, ...) { size_t ret; va_list ap; -- cgit v1.2.3