summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 d65980b4..04dce848 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
polish dtucker@)
- djm@cvs.openbsd.org 2005/06/17 02:44:33
[auth1.c] make this -Wsign-compare clean; ok avsm@ markus@
+ - (djm) [loginrec.c ssh-rand-helper.c] Fix -Wsign-compare for portable,
+ tested and fixes tim@
20050617
- (djm) OpenBSD CVS Sync
@@ -2747,4 +2749,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.3826 2005/06/18 21:36:10 djm Exp $
+$Id: ChangeLog,v 1.3827 2005/06/19 00:19:43 djm Exp $
diff --git a/configure.ac b/configure.ac
index 62a11fa1..027b2a4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.275 2005/06/07 07:53:40 dtucker Exp $
+# $Id: configure.ac,v 1.276 2005/06/19 00:19:43 djm Exp $
#
# Copyright (c) 1999-2004 Damien Miller
#
@@ -82,6 +82,7 @@ AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>])
if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
+ CFLAGS="$CFLAGS -Wsign-compare"
if test -z "$have_llong_max"; then
# retry LLONG_MAX with -std=gnu99, needed on some Linuxes
diff --git a/loginrec.c b/loginrec.c
index 361ac4cb..2543617b 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -165,7 +165,7 @@
# include <libutil.h>
#endif
-RCSID("$Id: loginrec.c,v 1.67 2005/02/15 11:19:28 dtucker Exp $");
+RCSID("$Id: loginrec.c,v 1.68 2005/06/19 00:19:43 djm Exp $");
/**
** prototypes for helper functions in this file
@@ -534,7 +534,7 @@ getlast_entry(struct logininfo *li)
* sure dst has enough space, if not just copy src (ugh)
*/
char *
-line_fullname(char *dst, const char *src, int dstsize)
+line_fullname(char *dst, const char *src, u_int dstsize)
{
memset(dst, '\0', dstsize);
if ((strncmp(src, "/dev/", 5) == 0) || (dstsize < (strlen(src) + 5)))
diff --git a/loginrec.h b/loginrec.h
index d1a12a85..8e339017 100644
--- a/loginrec.h
+++ b/loginrec.h
@@ -35,7 +35,7 @@
#include <netinet/in.h>
#include <sys/socket.h>
-/* RCSID("$Id: loginrec.h,v 1.9 2005/02/02 06:10:11 dtucker Exp $"); */
+/* 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
@@ -128,7 +128,7 @@ struct logininfo *login_get_lastlog(struct logininfo *li, const int uid);
unsigned int login_get_lastlog_time(const int uid);
/* produce various forms of the line filename */
-char *line_fullname(char *dst, const char *src, int dstsize);
+char *line_fullname(char *dst, const char *src, u_int dstsize);
char *line_stripname(char *dst, const char *src, int dstsize);
char *line_abbrevname(char *dst, const char *src, int dstsize);
diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c
index d7d8d0f3..aab51fdf 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.23 2005/02/16 02:32:30 dtucker Exp $");
+RCSID("$Id: ssh-rand-helper.c,v 1.24 2005/06/19 00:19:44 djm Exp $");
/* Number of bytes we write out */
#define OUTPUT_SEED_SIZE 48
@@ -123,7 +123,7 @@ get_random_bytes_prngd(unsigned char *buf, int len,
unsigned short tcp_port, char *socket_path)
{
int fd, addr_len, rval, errors;
- char msg[2];
+ u_char msg[2];
struct sockaddr_storage addr;
struct sockaddr_in *addr_in = (struct sockaddr_in *)&addr;
struct sockaddr_un *addr_un = (struct sockaddr_un *)&addr;
@@ -135,8 +135,8 @@ get_random_bytes_prngd(unsigned char *buf, int len,
if (socket_path != NULL &&
strlen(socket_path) >= sizeof(addr_un->sun_path))
fatal("Random pool path is too long");
- if (len > 255)
- fatal("Too many bytes to read from PRNGD");
+ if (len <= 0 || len > 255)
+ fatal("Too many bytes (%d) to read from PRNGD", len);
memset(&addr, '\0', sizeof(addr));
@@ -190,7 +190,7 @@ reopen:
goto done;
}
- if (atomicio(read, fd, buf, len) != len) {
+ if (atomicio(read, fd, buf, len) != (size_t)len) {
if (errno == EPIPE && errors < 10) {
close(fd);
errors++;