diff options
author | des <des@FreeBSD.org> | 1999-07-23 14:45:21 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 1999-07-23 14:45:21 +0000 |
commit | da41b19a5a5999d513c50f842d2cb4aaa7511a60 (patch) | |
tree | f8cae0ca2f22a96e98345776c916885066729c10 /usr.sbin | |
parent | dc44066b55b30a7b13c26279da447d2e848d7d61 (diff) | |
download | FreeBSD-src-da41b19a5a5999d513c50f842d2cb4aaa7511a60.zip FreeBSD-src-da41b19a5a5999d513c50f842d2cb4aaa7511a60.tar.gz |
Don't match up TCP services with UDP sockets.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/inetd/inetd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 6f6778e..b3b3a36 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -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; |