Don't match up TCP services with UDP sockets.
This commit is contained in:
parent
f22ff34fba
commit
fc2cff3185
|
@ -42,7 +42,7 @@ static const char copyright[] =
|
|||
static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkeley) 4/13/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: inetd.c,v 1.67 1999/07/22 16:10:40 sheldonh Exp $";
|
||||
"$Id: inetd.c,v 1.68 1999/07/22 16:29:48 sheldonh Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
@ -1036,6 +1036,8 @@ matchservent(name1, name2, proto)
|
|||
char **alias;
|
||||
struct servent *se;
|
||||
|
||||
if (strcmp(name1, name2) == 0)
|
||||
return(1);
|
||||
if ((se = getservbyname(name1, proto)) != NULL) {
|
||||
if (strcmp(name2, se->s_name) == 0)
|
||||
return(1);
|
||||
|
@ -1320,8 +1322,7 @@ more:
|
|||
struct biltin *bi;
|
||||
|
||||
for (bi = biltins; bi->bi_service; bi++)
|
||||
if ((bi->bi_socktype == sep->se_socktype &&
|
||||
strcmp(bi->bi_service, sep->se_service) == 0) ||
|
||||
if (bi->bi_socktype == sep->se_socktype &&
|
||||
matchservent(bi->bi_service, sep->se_service,
|
||||
sep->se_proto))
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue