summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-09-06 19:43:55 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-09-06 19:43:55 +0000
commitbe77049622266cc17c3bdcf5a5133d4d840c017e (patch)
tree961945ab4f9c5985e18ccf2b03d4c0e4187fce58
parent11cebf79245d373cc7a70e7f78fff2b465e010f2 (diff)
use socklen_t more; henning ok
-rw-r--r--libexec/comsat/comsat.c6
-rw-r--r--libexec/fingerd/fingerd.c6
-rw-r--r--libexec/rpc.rquotad/rquotad.c6
-rw-r--r--libexec/rpc.rstatd/rstatd.c7
-rw-r--r--libexec/rpc.rusersd/rusersd.c7
-rw-r--r--libexec/rpc.rwalld/rwalld.c7
-rw-r--r--libexec/rpc.sprayd/sprayd.c6
-rw-r--r--libexec/rshd/rshd.c10
-rw-r--r--libexec/talkd/talkd.c7
-rw-r--r--libexec/tftpd/tftpd.c32
-rw-r--r--libexec/uucpd/uucpd.c6
11 files changed, 51 insertions, 49 deletions
diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c
index 48273cc90f2..ea000a0d3be 100644
--- a/libexec/comsat/comsat.c
+++ b/libexec/comsat/comsat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: comsat.c,v 1.25 2002/08/22 17:45:16 pb Exp $ */
+/* $OpenBSD: comsat.c,v 1.26 2002/09/06 19:43:54 deraadt Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -41,7 +41,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)comsat.c 8.1 (Berkeley) 6/4/93";*/
-static char rcsid[] = "$OpenBSD: comsat.c,v 1.25 2002/08/22 17:45:16 pb Exp $";
+static char rcsid[] = "$OpenBSD: comsat.c,v 1.26 2002/09/06 19:43:54 deraadt Exp $";
#endif /* not lint */
#include <sys/limits.h>
@@ -93,7 +93,7 @@ main(int argc, char *argv[])
struct sockaddr_storage from;
struct sigaction sa;
int cc;
- int fromlen;
+ socklen_t fromlen;
char msgbuf[100];
sigset_t sigset;
diff --git a/libexec/fingerd/fingerd.c b/libexec/fingerd/fingerd.c
index 168bafb2384..c2b434e53ce 100644
--- a/libexec/fingerd/fingerd.c
+++ b/libexec/fingerd/fingerd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fingerd.c,v 1.28 2002/07/03 23:39:03 deraadt Exp $ */
+/* $OpenBSD: fingerd.c,v 1.29 2002/09/06 19:43:54 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "from: @(#)fingerd.c 8.1 (Berkeley) 6/4/93";
#else
-static char rcsid[] = "$OpenBSD: fingerd.c,v 1.28 2002/07/03 23:39:03 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: fingerd.c,v 1.29 2002/09/06 19:43:54 deraadt Exp $";
#endif
#endif /* not lint */
@@ -128,7 +128,7 @@ main(int argc, char *argv[])
if (logging) {
struct sockaddr_storage ss;
struct sockaddr *sa;
- int sval;
+ socklen_t sval;
sval = sizeof(ss);
if (getpeername(0, (struct sockaddr *)&ss, &sval) < 0) {
diff --git a/libexec/rpc.rquotad/rquotad.c b/libexec/rpc.rquotad/rquotad.c
index 03f4e24eb64..d7640db7d7e 100644
--- a/libexec/rpc.rquotad/rquotad.c
+++ b/libexec/rpc.rquotad/rquotad.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rquotad.c,v 1.15 2002/07/03 23:39:03 deraadt Exp $ */
+/* $OpenBSD: rquotad.c,v 1.16 2002/09/06 19:43:54 deraadt Exp $ */
/*
* by Manuel Bouyer (bouyer@ensta.fr). Public domain.
@@ -50,7 +50,7 @@ struct fs_stat *fs_begin = NULL;
int from_inetd = 1;
void
-cleanup(void)
+cleanup(int signo)
{
(void) pmap_unset(RQUOTAPROG, RQUOTAVERS); /* XXX signal races */
_exit(0);
@@ -63,7 +63,7 @@ main(int argc, char *argv[])
int sock = 0;
int proto = 0;
struct sockaddr_in from;
- int fromlen;
+ socklen_t fromlen;
fromlen = sizeof(from);
if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) {
diff --git a/libexec/rpc.rstatd/rstatd.c b/libexec/rpc.rstatd/rstatd.c
index 86a35afd986..05efe90a358 100644
--- a/libexec/rpc.rstatd/rstatd.c
+++ b/libexec/rpc.rstatd/rstatd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rstatd.c,v 1.12 2002/07/15 23:47:57 deraadt Exp $ */
+/* $OpenBSD: rstatd.c,v 1.13 2002/09/06 19:43:54 deraadt Exp $ */
/*-
* Copyright (c) 1993, John Brezak
@@ -34,7 +34,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: rstatd.c,v 1.12 2002/07/15 23:47:57 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rstatd.c,v 1.13 2002/09/06 19:43:54 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -82,7 +82,8 @@ cleanup(void)
int
main(int argc, char *argv[])
{
- int sock = 0, proto = 0, fromlen;
+ int sock = 0, proto = 0;
+ socklen_t fromlen;
struct passwd *pw;
struct sockaddr_in from;
SVCXPRT *transp;
diff --git a/libexec/rpc.rusersd/rusersd.c b/libexec/rpc.rusersd/rusersd.c
index a9913eded31..299aa40e182 100644
--- a/libexec/rpc.rusersd/rusersd.c
+++ b/libexec/rpc.rusersd/rusersd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rusersd.c,v 1.10 2002/07/15 23:47:57 deraadt Exp $ */
+/* $OpenBSD: rusersd.c,v 1.11 2002/09/06 19:43:54 deraadt Exp $ */
/*-
* Copyright (c) 1993 John Brezak
@@ -29,7 +29,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: rusersd.c,v 1.10 2002/07/15 23:47:57 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rusersd.c,v 1.11 2002/09/06 19:43:54 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -64,7 +64,8 @@ cleanup(int signo)
int
main(int argc, char *argv[])
{
- int sock = 0, proto = 0, fromlen;
+ int sock = 0, proto = 0;
+ socklen_t fromlen;
struct sockaddr_in from;
struct passwd *pw;
SVCXPRT *transp;
diff --git a/libexec/rpc.rwalld/rwalld.c b/libexec/rpc.rwalld/rwalld.c
index e83aefb13d5..efd668ec4a3 100644
--- a/libexec/rpc.rwalld/rwalld.c
+++ b/libexec/rpc.rwalld/rwalld.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rwalld.c,v 1.8 2002/09/05 00:21:24 deraadt Exp $ */
+/* $OpenBSD: rwalld.c,v 1.9 2002/09/06 19:43:54 deraadt Exp $ */
/*
* Copyright (c) 1993 Christopher G. Demetriou
@@ -30,7 +30,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: rwalld.c,v 1.8 2002/09/05 00:21:24 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rwalld.c,v 1.9 2002/09/06 19:43:54 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -67,7 +67,8 @@ cleanup(int signo)
int
main(int argc, char *argv[])
{
- int sock = 0, proto = 0, fromlen;
+ int sock = 0, proto = 0;
+ socklen_t fromlen;
struct sockaddr_in from;
SVCXPRT *transp;
diff --git a/libexec/rpc.sprayd/sprayd.c b/libexec/rpc.sprayd/sprayd.c
index 7a9fa14c0aa..ee3684ad855 100644
--- a/libexec/rpc.sprayd/sprayd.c
+++ b/libexec/rpc.sprayd/sprayd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sprayd.c,v 1.6 2002/06/29 07:30:01 deraadt Exp $*/
+/* $OpenBSD: sprayd.c,v 1.7 2002/09/06 19:43:54 deraadt Exp $*/
/*
* Copyright (c) 1994 Christos Zoulas
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: sprayd.c,v 1.6 2002/06/29 07:30:01 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: sprayd.c,v 1.7 2002/09/06 19:43:54 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -72,7 +72,7 @@ main(int argc, char *argv[])
int sock = 0;
int proto = 0;
struct sockaddr_in from;
- int fromlen;
+ socklen_t fromlen;
/*
* See if inetd started us
diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c
index 6f09dd9012c..0991eeccfac 100644
--- a/libexec/rshd/rshd.c
+++ b/libexec/rshd/rshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rshd.c,v 1.47 2002/07/03 23:27:19 deraadt Exp $ */
+/* $OpenBSD: rshd.c,v 1.48 2002/09/06 19:43:54 deraadt Exp $ */
/*-
* Copyright (c) 1988, 1989, 1992, 1993, 1994
@@ -41,7 +41,7 @@ static char copyright[] =
#ifndef lint
/* from: static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; */
-static char *rcsid = "$OpenBSD: rshd.c,v 1.47 2002/07/03 23:27:19 deraadt Exp $";
+static char *rcsid = "$OpenBSD: rshd.c,v 1.48 2002/09/06 19:43:54 deraadt Exp $";
#endif /* not lint */
/*
@@ -123,7 +123,8 @@ main(int argc, char *argv[])
{
extern int __check_rhosts_file;
struct linger linger;
- int ch, on = 1, fromlen;
+ int ch, on = 1;
+ socklen_t fromlen;
struct sockaddr_storage from;
openlog("rshd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
@@ -283,7 +284,8 @@ doit(struct sockaddr *fromp)
#ifdef IP_OPTIONS
if (fromp->sa_family == AF_INET) {
struct ipoption opts;
- int optsize = sizeof(opts), ipproto, i;
+ socklen_t optsize = sizeof(opts);
+ int ipproto, i;
struct protoent *ip;
if ((ip = getprotobyname("ip")) != NULL)
diff --git a/libexec/talkd/talkd.c b/libexec/talkd/talkd.c
index e3c835a40cc..51b8e489214 100644
--- a/libexec/talkd/talkd.c
+++ b/libexec/talkd/talkd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: talkd.c,v 1.13 2002/07/03 16:59:05 vincent Exp $ */
+/* $OpenBSD: talkd.c,v 1.14 2002/09/06 19:43:54 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)talkd.c 5.8 (Berkeley) 2/26/91";*/
-static char rcsid[] = "$Id: talkd.c,v 1.13 2002/07/03 16:59:05 vincent Exp $";
+static char rcsid[] = "$Id: talkd.c,v 1.14 2002/09/06 19:43:54 deraadt Exp $";
#endif /* not lint */
/*
@@ -100,8 +100,9 @@ main(argc, argv)
for (;;) {
CTL_RESPONSE response;
- int cc, len = sizeof(response.addr);
+ socklen_t len = sizeof(response.addr);
CTL_MSG request;
+ int cc;
cc = recvfrom(STDIN_FILENO, (char *)&request,
sizeof (request), 0, (struct sockaddr *)&response.addr,
diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c
index 1656169cae4..9c150ac59d7 100644
--- a/libexec/tftpd/tftpd.c
+++ b/libexec/tftpd/tftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftpd.c,v 1.25 2002/07/03 23:39:03 deraadt Exp $ */
+/* $OpenBSD: tftpd.c,v 1.26 2002/09/06 19:43:54 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)tftpd.c 5.13 (Berkeley) 2/26/91";*/
-static char rcsid[] = "$OpenBSD: tftpd.c,v 1.25 2002/07/03 23:39:03 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tftpd.c,v 1.26 2002/09/06 19:43:54 deraadt Exp $";
#endif /* not lint */
/*
@@ -84,7 +84,7 @@ int maxtimeout = 5*TIMEOUT;
char buf[PKTSIZE];
char ackbuf[PKTSIZE];
struct sockaddr_storage from;
-int fromlen;
+socklen_t fromlen;
int ndirs;
char **dirs;
@@ -129,14 +129,11 @@ usage(void)
int
main(int argc, char *argv[])
{
+ int n = 0, on = 1, fd = 0, i, c;
struct tftphdr *tp;
struct passwd *pw;
- int n = 0;
- int on = 1;
- int fd = 0;
pid_t pid = 0;
- int i, j;
- int c;
+ socklen_t j;
openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
@@ -148,7 +145,6 @@ main(int argc, char *argv[])
case 's':
secure = 1;
break;
-
default:
usage();
break;
@@ -193,10 +189,10 @@ main(int argc, char *argv[])
}
}
- (void) setegid(pw->pw_gid);
- (void) setgid(pw->pw_gid);
- (void) seteuid(pw->pw_uid);
- (void) setuid(pw->pw_uid);
+ setegid(pw->pw_gid);
+ setgid(pw->pw_gid);
+ seteuid(pw->pw_uid);
+ setuid(pw->pw_uid);
if (ioctl(fd, FIONBIO, &on) < 0) {
syslog(LOG_ERR, "ioctl(FIONBIO): %m");
@@ -346,8 +342,8 @@ int
validate_access(char *filename, int mode)
{
struct stat stbuf;
- int fd, wmode;
char *cp, **dirp;
+ int fd, wmode;
if (!secure) {
if (*filename != '/')
@@ -445,7 +441,7 @@ sendfile(struct formats *pf)
dp->th_opcode = htons((u_short)DATA);
dp->th_block = htons((u_short)block);
timeout = 0;
- (void) setjmp(timeoutbuf);
+ setjmp(timeoutbuf);
send_data:
if (send(peer, dp, size + 4, 0) != size + 4) {
@@ -482,7 +478,7 @@ send_data:
block++;
} while (size == SEGSIZE);
abort:
- (void) fclose(file);
+ fclose(file);
return (1);
}
@@ -512,7 +508,7 @@ recvfile(struct formats *pf)
ap->th_opcode = htons((u_short)ACK);
ap->th_block = htons((u_short)block);
block++;
- (void) setjmp(timeoutbuf);
+ setjmp(timeoutbuf);
send_ack:
if (send(peer, ackbuf, 4, 0) != 4) {
syslog(LOG_ERR, "tftpd: write: %m");
@@ -595,8 +591,8 @@ void
nak(int error)
{
struct tftphdr *tp;
- int length;
struct errmsg *pe;
+ int length;
tp = (struct tftphdr *)buf;
tp->th_opcode = htons((u_short)ERROR);
diff --git a/libexec/uucpd/uucpd.c b/libexec/uucpd/uucpd.c
index f1e77d8c747..d65a1ebd9b1 100644
--- a/libexec/uucpd/uucpd.c
+++ b/libexec/uucpd/uucpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uucpd.c,v 1.24 2002/07/03 23:39:03 deraadt Exp $ */
+/* $OpenBSD: uucpd.c,v 1.25 2002/09/06 19:43:54 deraadt Exp $ */
/*
* Copyright (c) 1985 The Regents of the University of California.
@@ -44,7 +44,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)uucpd.c 5.10 (Berkeley) 2/26/91";*/
-static char rcsid[] = "$OpenBSD: uucpd.c,v 1.24 2002/07/03 23:39:03 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: uucpd.c,v 1.25 2002/09/06 19:43:54 deraadt Exp $";
#endif /* not lint */
/*
@@ -79,7 +79,7 @@ void dologout(void);
void dologin(struct passwd *, struct sockaddr_in *);
struct sockaddr_in hisctladdr;
-int hisaddrlen = sizeof hisctladdr;
+socklen_t hisaddrlen = sizeof hisctladdr;
struct sockaddr_in myctladdr;
pid_t mypid;