Commit 52a8e88d authored by Marco d'Itri's avatar Marco d'Itri

Merge upstream release v0.20140418

parents 38f58e65 d99ecd28
2014-04-19 00:04 jmc
* inetd.8: remove references to rshd;
2013-11-23 18:24 deraadt
* inetd.c: obvious unsigned char casts for ctype
2013-11-12 20:44 deraadt
* inetd.c: missing protos
2013-04-19 20:03 deraadt
* inetd.c: for datagrams, assume other protocols should fail ok
millert
2013-03-11 18:40 deraadt
* inetd.c: handle ECONNABORTED errors from accept(). In many code
blocks they can be ignored silently and without aborting, much
like EINTR and EWOULDBLOCK are. ok's from various maintainers of
these directories...
2012-04-19 16:33 gsoares
* inetd.c: small cleanup(%hd -> %d)
yes deraadt@
2012-03-06 02:25 dlg
* inetd.8: clean up some newly created lies now that tftpd doesnt
run out of inetd.
poke by deraadt@
2009-12-29 11:25 sobrado 2009-12-29 11:25 sobrado
* inetd.8: replace a few remaining UNIX terms with .Ux macros; this * inetd.8: replace a few remaining UNIX terms with .Ux macros; this
......
.\" $OpenBSD: inetd.8,v 1.33 2008/06/28 10:54:45 sobrado Exp $ .\" $OpenBSD: inetd.8,v 1.35 2012/03/06 01:25:47 dlg Exp $
.\" Copyright (c) 1985, 1991 The Regents of the University of California. .\" Copyright (c) 1985, 1991 The Regents of the University of California.
.\" All rights reserved. .\" All rights reserved.
.\" .\"
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
.\" .\"
.\" from: @(#)inetd.8 6.7 (Berkeley) 3/16/91 .\" from: @(#)inetd.8 6.7 (Berkeley) 3/16/91
.\" .\"
.Dd $Mdocdate: December 29 2009 $ .Dd $Mdocdate: April 18 2014 $
.Dt INETD 8 .Dt INETD 8
.Os .Os
.Sh NAME .Sh NAME
...@@ -240,15 +240,6 @@ and ...@@ -240,15 +240,6 @@ and
.Xr talkd 8 .Xr talkd 8
are both examples of the latter type of are both examples of the latter type of
datagram server. datagram server.
.Xr tftpd 8
is an exception; it is a datagram server that establishes pseudo-connections.
It must be listed as
.Dq wait
in order to avoid a race;
the server reads the first packet, creates a new socket,
and then forks and exits to allow
.Nm inetd
to check for new service requests to spawn new servers.
The optional The optional
.Dq max .Dq max
suffix (separated from suffix (separated from
...@@ -382,9 +373,7 @@ only IPv6 traffic will be routed to the server. ...@@ -382,9 +373,7 @@ only IPv6 traffic will be routed to the server.
.Xr ftp-proxy 8 , .Xr ftp-proxy 8 ,
.Xr ftpd 8 , .Xr ftpd 8 ,
.Xr identd 8 , .Xr identd 8 ,
.Xr rshd 8 , .Xr talkd 8
.Xr talkd 8 ,
.Xr tftpd 8
.Sh HISTORY .Sh HISTORY
The The
.Nm .Nm
......
/* $OpenBSD: inetd.c,v 1.131 2009/10/27 23:59:51 deraadt Exp $ */ /* $OpenBSD: inetd.c,v 1.136 2013/11/12 19:44:44 deraadt Exp $ */
/* /*
* Copyright (c) 1983,1991 The Regents of the University of California. * Copyright (c) 1983,1991 The Regents of the University of California.
...@@ -290,6 +290,12 @@ int dg_broadcast(struct in_addr *in); ...@@ -290,6 +290,12 @@ int dg_broadcast(struct in_addr *in);
#define NUMINT (sizeof(intab) / sizeof(struct inent)) #define NUMINT (sizeof(intab) / sizeof(struct inent))
char *CONFIG = _PATH_INETDCONF; char *CONFIG = _PATH_INETDCONF;
void fd_grow(fd_set **fdsp, int *bytes, int fd);
int dg_badinput(struct sockaddr *sa);
void inetd_setproctitle(char *a, int s);
void initring(void);
u_int32_t machtime(void);
void void
fd_grow(fd_set **fdsp, int *bytes, int fd) fd_grow(fd_set **fdsp, int *bytes, int fd)
{ {
...@@ -496,9 +502,10 @@ gettcp(struct servtab *sep) ...@@ -496,9 +502,10 @@ gettcp(struct servtab *sep)
if (debug) if (debug)
fprintf(stderr, "accept, ctrl %d\n", ctrl); fprintf(stderr, "accept, ctrl %d\n", ctrl);
if (ctrl < 0) { if (ctrl < 0) {
if (errno == EINTR) if (errno != EWOULDBLOCK && errno != EINTR &&
return -1; errno != ECONNABORTED)
syslog(LOG_WARNING, "accept (for %s): %m", sep->se_service); syslog(LOG_WARNING, "accept (for %s): %m",
sep->se_service);
return -1; return -1;
} }
if ((sep->se_family == AF_INET || sep->se_family == AF_INET6) && if ((sep->se_family == AF_INET || sep->se_family == AF_INET6) &&
...@@ -565,8 +572,8 @@ dg_badinput(struct sockaddr *sa) ...@@ -565,8 +572,8 @@ dg_badinput(struct sockaddr *sa)
} }
break; break;
default: default:
/* XXX unsupported af, is it safe to assume it to be safe? */ /* Unsupported AF */
return 0; goto bad;
} }
if (port < IPPORT_RESERVED || port == NFS_PORT) if (port < IPPORT_RESERVED || port == NFS_PORT)
...@@ -759,7 +766,8 @@ doconfig(void) ...@@ -759,7 +766,8 @@ doconfig(void)
/* XXX */ /* XXX */
strncpy(protoname, sep->se_proto, strncpy(protoname, sep->se_proto,
sizeof(protoname)); sizeof(protoname));
if (isdigit(protoname[strlen(protoname) - 1])) if (isdigit((unsigned char)
protoname[strlen(protoname) - 1]))
protoname[strlen(protoname) - 1] = '\0'; protoname[strlen(protoname) - 1] = '\0';
sp = getservbyname(sep->se_service, sp = getservbyname(sep->se_service,
protoname); protoname);
...@@ -814,7 +822,8 @@ doconfig(void) ...@@ -814,7 +822,8 @@ doconfig(void)
/* XXX */ /* XXX */
strncpy(protoname, sep->se_proto, strncpy(protoname, sep->se_proto,
sizeof(protoname)); sizeof(protoname));
if (isdigit(protoname[strlen(protoname) - 1])) if (isdigit((unsigned char)
protoname[strlen(protoname) - 1]))
protoname[strlen(protoname) - 1] = '\0'; protoname[strlen(protoname) - 1] = '\0';
sp = getservbyname(sep->se_service, sp = getservbyname(sep->se_service,
protoname); protoname);
...@@ -1663,7 +1672,7 @@ initring(void) ...@@ -1663,7 +1672,7 @@ initring(void)
endring = ring; endring = ring;
for (i = 0; i <= sizeof ring; ++i) for (i = 0; i <= sizeof ring; ++i)
if (isprint(i)) if (isprint((unsigned char)i))
*endring++ = i; *endring++ = i;
} }
...@@ -1841,7 +1850,7 @@ print_service(char *action, struct servtab *sep) ...@@ -1841,7 +1850,7 @@ print_service(char *action, struct servtab *sep)
fprintf(stderr, "proto=%s,", sep->se_proto); fprintf(stderr, "proto=%s,", sep->se_proto);
fprintf(stderr, fprintf(stderr,
" wait.max=%hd.%d user:group=%s:%s builtin=%lx server=%s\n", " wait.max=%d.%d user:group=%s:%s builtin=%lx server=%s\n",
sep->se_wait, sep->se_max, sep->se_user, sep->se_wait, sep->se_max, sep->se_user,
sep->se_group ? sep->se_group : "wheel", sep->se_group ? sep->se_group : "wheel",
(long)sep->se_bi, sep->se_server); (long)sep->se_bi, sep->se_server);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment