]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Host aliases need to be checked when netgroups is used in exports.
authorSteve Dickson <steved@redhat.com>
Wed, 29 Apr 2009 16:38:02 +0000 (12:38 -0400)
committerSteve Dickson <steved@redhat.com>
Wed, 29 Apr 2009 16:38:02 +0000 (12:38 -0400)
Signed-off-by: Steve Dickson <steved@redhat.com>
support/export/client.c

index 1cb242f33fa62b993695df7c8623c7d9d9318a45..5fcf35539cad917c2333d9a370f5bca6fcb7f771 100644 (file)
@@ -371,7 +371,7 @@ client_check(nfs_client *clp, struct hostent *hp)
 #ifdef HAVE_INNETGR
                {
                        char    *dot;
-                       int     match;
+                       int     match, i;
                        struct hostent *nhp = NULL;
                        struct sockaddr_in addr;
 
@@ -380,6 +380,12 @@ client_check(nfs_client *clp, struct hostent *hp)
                        if (innetgr(cname+1, hname, NULL, NULL))
                                return 1;
 
+                       /* try the aliases as well */
+                       for (i = 0; hp->h_aliases[i]; i++) {
+                               if (innetgr(cname+1, hp->h_aliases[i], NULL, NULL))
+                                       return 1;
+                       }
+
                        /* If hname is ip address convert to FQDN */
                        if (inet_aton(hname, &addr.sin_addr) &&
                           (nhp = gethostbyaddr((const char *)&(addr.sin_addr),