1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 07:13:36 +02:00

use socklen_t more; henning ok

This commit is contained in:
deraadt
2002-09-06 19:43:54 +00:00
parent 1d8e757697
commit 71fc4cb248
11 changed files with 51 additions and 49 deletions
+3 -3
View File
@@ -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;
+3 -3
View File
@@ -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) {
+3 -3
View File
@@ -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) {
+4 -3
View File
@@ -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;
+4 -3
View File
@@ -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;
+4 -3
View File
@@ -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;
+3 -3
View File
@@ -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
+6 -4
View File
@@ -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)
+4 -3
View File
@@ -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,
+14 -18
View File
@@ -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);
+3 -3
View File
@@ -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;