summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-06-19 10:19:43 +1000
committerDamien Miller <djm@mindrot.org>2005-06-19 10:19:43 +1000
commit52c8afeec57cd8f04e08816e1f4563e689f70f83 (patch)
treec17e191ca4e5f8688c2ef238e43e6a2a1698cecd
parent106075314795dab5eeea6ca547dd6a7573168f7a (diff)
- (djm) [loginrec.c ssh-rand-helper.c] Fix -Wsign-compare for portable,
tested and fixes tim@
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac3
-rw-r--r--loginrec.c4
-rw-r--r--loginrec.h4
-rw-r--r--ssh-rand-helper.c10
5 files changed, 14 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index d65980b44..04dce8489 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
6 polish dtucker@) 6 polish dtucker@)
7 - djm@cvs.openbsd.org 2005/06/17 02:44:33 7 - djm@cvs.openbsd.org 2005/06/17 02:44:33
8 [auth1.c] make this -Wsign-compare clean; ok avsm@ markus@ 8 [auth1.c] make this -Wsign-compare clean; ok avsm@ markus@
9 - (djm) [loginrec.c ssh-rand-helper.c] Fix -Wsign-compare for portable,
10 tested and fixes tim@
9 11
1020050617 1220050617
11 - (djm) OpenBSD CVS Sync 13 - (djm) OpenBSD CVS Sync
@@ -2747,4 +2749,4 @@
2747 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 2749 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
2748 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 2750 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
2749 2751
2750$Id: ChangeLog,v 1.3826 2005/06/18 21:36:10 djm Exp $ 2752$Id: ChangeLog,v 1.3827 2005/06/19 00:19:43 djm Exp $
diff --git a/configure.ac b/configure.ac
index 62a11fa1e..027b2a4e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.275 2005/06/07 07:53:40 dtucker Exp $ 1# $Id: configure.ac,v 1.276 2005/06/19 00:19:43 djm Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -82,6 +82,7 @@ AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>])
82 82
83if test "$GCC" = "yes" || test "$GCC" = "egcs"; then 83if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
84 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized" 84 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
85 CFLAGS="$CFLAGS -Wsign-compare"
85 86
86 if test -z "$have_llong_max"; then 87 if test -z "$have_llong_max"; then
87 # retry LLONG_MAX with -std=gnu99, needed on some Linuxes 88 # retry LLONG_MAX with -std=gnu99, needed on some Linuxes
diff --git a/loginrec.c b/loginrec.c
index 361ac4cb7..2543617ba 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -165,7 +165,7 @@
165# include <libutil.h> 165# include <libutil.h>
166#endif 166#endif
167 167
168RCSID("$Id: loginrec.c,v 1.67 2005/02/15 11:19:28 dtucker Exp $"); 168RCSID("$Id: loginrec.c,v 1.68 2005/06/19 00:19:43 djm Exp $");
169 169
170/** 170/**
171 ** prototypes for helper functions in this file 171 ** prototypes for helper functions in this file
@@ -534,7 +534,7 @@ getlast_entry(struct logininfo *li)
534 * sure dst has enough space, if not just copy src (ugh) 534 * sure dst has enough space, if not just copy src (ugh)
535 */ 535 */
536char * 536char *
537line_fullname(char *dst, const char *src, int dstsize) 537line_fullname(char *dst, const char *src, u_int dstsize)
538{ 538{
539 memset(dst, '\0', dstsize); 539 memset(dst, '\0', dstsize);
540 if ((strncmp(src, "/dev/", 5) == 0) || (dstsize < (strlen(src) + 5))) 540 if ((strncmp(src, "/dev/", 5) == 0) || (dstsize < (strlen(src) + 5)))
diff --git a/loginrec.h b/loginrec.h
index d1a12a853..8e3390178 100644
--- a/loginrec.h
+++ b/loginrec.h
@@ -35,7 +35,7 @@
35#include <netinet/in.h> 35#include <netinet/in.h>
36#include <sys/socket.h> 36#include <sys/socket.h>
37 37
38/* RCSID("$Id: loginrec.h,v 1.9 2005/02/02 06:10:11 dtucker Exp $"); */ 38/* RCSID("$Id: loginrec.h,v 1.10 2005/06/19 00:19:44 djm Exp $"); */
39 39
40/** 40/**
41 ** you should use the login_* calls to work around platform dependencies 41 ** you should use the login_* calls to work around platform dependencies
@@ -128,7 +128,7 @@ struct logininfo *login_get_lastlog(struct logininfo *li, const int uid);
128unsigned int login_get_lastlog_time(const int uid); 128unsigned int login_get_lastlog_time(const int uid);
129 129
130/* produce various forms of the line filename */ 130/* produce various forms of the line filename */
131char *line_fullname(char *dst, const char *src, int dstsize); 131char *line_fullname(char *dst, const char *src, u_int dstsize);
132char *line_stripname(char *dst, const char *src, int dstsize); 132char *line_stripname(char *dst, const char *src, int dstsize);
133char *line_abbrevname(char *dst, const char *src, int dstsize); 133char *line_abbrevname(char *dst, const char *src, int dstsize);
134 134
diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c
index d7d8d0f3b..aab51fdf7 100644
--- a/ssh-rand-helper.c
+++ b/ssh-rand-helper.c
@@ -39,7 +39,7 @@
39#include "pathnames.h" 39#include "pathnames.h"
40#include "log.h" 40#include "log.h"
41 41
42RCSID("$Id: ssh-rand-helper.c,v 1.23 2005/02/16 02:32:30 dtucker Exp $"); 42RCSID("$Id: ssh-rand-helper.c,v 1.24 2005/06/19 00:19:44 djm Exp $");
43 43
44/* Number of bytes we write out */ 44/* Number of bytes we write out */
45#define OUTPUT_SEED_SIZE 48 45#define OUTPUT_SEED_SIZE 48
@@ -123,7 +123,7 @@ get_random_bytes_prngd(unsigned char *buf, int len,
123 unsigned short tcp_port, char *socket_path) 123 unsigned short tcp_port, char *socket_path)
124{ 124{
125 int fd, addr_len, rval, errors; 125 int fd, addr_len, rval, errors;
126 char msg[2]; 126 u_char msg[2];
127 struct sockaddr_storage addr; 127 struct sockaddr_storage addr;
128 struct sockaddr_in *addr_in = (struct sockaddr_in *)&addr; 128 struct sockaddr_in *addr_in = (struct sockaddr_in *)&addr;
129 struct sockaddr_un *addr_un = (struct sockaddr_un *)&addr; 129 struct sockaddr_un *addr_un = (struct sockaddr_un *)&addr;
@@ -135,8 +135,8 @@ get_random_bytes_prngd(unsigned char *buf, int len,
135 if (socket_path != NULL && 135 if (socket_path != NULL &&
136 strlen(socket_path) >= sizeof(addr_un->sun_path)) 136 strlen(socket_path) >= sizeof(addr_un->sun_path))
137 fatal("Random pool path is too long"); 137 fatal("Random pool path is too long");
138 if (len > 255) 138 if (len <= 0 || len > 255)
139 fatal("Too many bytes to read from PRNGD"); 139 fatal("Too many bytes (%d) to read from PRNGD", len);
140 140
141 memset(&addr, '\0', sizeof(addr)); 141 memset(&addr, '\0', sizeof(addr));
142 142
@@ -190,7 +190,7 @@ reopen:
190 goto done; 190 goto done;
191 } 191 }
192 192
193 if (atomicio(read, fd, buf, len) != len) { 193 if (atomicio(read, fd, buf, len) != (size_t)len) {
194 if (errno == EPIPE && errors < 10) { 194 if (errno == EPIPE && errors < 10) {
195 close(fd); 195 close(fd);
196 errors++; 196 errors++;