Thu Jul 11 20:09:55 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
authorroland <roland>
Fri, 12 Jul 1996 00:11:53 +0000 (00:11 +0000)
committerroland <roland>
Fri, 12 Jul 1996 00:11:53 +0000 (00:11 +0000)
* nss/nss_files/files-service.c (getservbyname): Take second arg PROTO
and check it.

nss/nss_files/files-service.c

index 5dea476..1bd26d1 100644 (file)
@@ -40,8 +40,13 @@ LINE_PARSER
 #include GENERIC
 
 DB_LOOKUP (servbyname, 1 + strlen (name), (".%s", name),
-          LOOKUP_NAME (s_name, s_aliases),
-          const char *name)
+          {
+            /* Must match both protocol and name.  */
+            if (strcmp (result->s_proto, proto))
+              continue;
+            LOOKUP_NAME (s_name, s_aliases)
+          },
+          const char *name, const char *proto)
 
 DB_LOOKUP (servbyport, 20, ("=%d", port),
           {