diff options
author | Steve Dickson <steved@redhat.com> | 2009-04-29 12:38:02 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-04-29 12:38:02 -0400 |
commit | 6a72b8af3abaf3792702c834bab5a5049818f9c6 (patch) | |
tree | 822476c078e83b55016a5ebfc369d165b04ec59c /support/export/client.c | |
parent | 9a8feae5533c41c4b069abc7de64b74c6e0983e3 (diff) | |
download | nfs-utils-6a72b8af3abaf3792702c834bab5a5049818f9c6.tar.gz nfs-utils-6a72b8af3abaf3792702c834bab5a5049818f9c6.tar.xz nfs-utils-6a72b8af3abaf3792702c834bab5a5049818f9c6.zip |
Host aliases need to be checked when netgroups is used in exports.
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/export/client.c')
-rw-r--r-- | support/export/client.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/support/export/client.c b/support/export/client.c index 1cb242f..5fcf355 100644 --- a/support/export/client.c +++ b/support/export/client.c @@ -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), |