mirror of
https://github.com/troglobit/finit.git
synced 2026-11-18 19:30:56 +00:00
inetd_match(): Fix bug in matcher, make sure to also compare protocol!
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
6a27ad8997
commit
534979e6c7
1 file changed
+4
-2
@@ -378,11 +378,13 @@ int inetd_match(inetd_t *inetd, char *service, char *proto, char *port)
|
|||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
struct servent *sv = NULL;
|
struct servent *sv = NULL;
|
||||||
|
struct protoent *pv = NULL;
|
||||||
|
|
||||||
if (getent(service, proto, &sv, NULL))
|
if (getent(service, proto, &sv, &pv))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (inetd->port == ntohs(sv->s_port))
|
if (inetd->proto == ntohs(pv->p_proto) &&
|
||||||
|
inetd->port == ntohs(sv->s_port))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user