]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
2001-05-06 Anne Milicia <milicia@missioncriticallinux.com>
authorhjl <hjl>
Mon, 7 May 2001 00:54:18 +0000 (00:54 +0000)
committerhjl <hjl>
Mon, 7 May 2001 00:54:18 +0000 (00:54 +0000)
* support/export/client.c (client_check): Check IP address
againet netgroup.

2001-05-06  Neil Brown <neilb@cse.unsw.edu.au>

* support/export/client.c (client_gettype): Treat `*' as
MCL_ANONYMOUS.

ChangeLog
support/export/client.c

index 72d52f30deaeff5cb2824443cc7a827be19c1a2f..1760d41e5e8d171b5737f321f9f25288f402df9b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2001-05-06  Anne Milicia <milicia@missioncriticallinux.com>
+
+       * support/export/client.c (client_check): Check IP address
+       againet netgroup.
+
+2001-05-06  Neil Brown <neilb@cse.unsw.edu.au>
+
+       * support/export/client.c (client_gettype): Treat `*' as
+       MCL_ANONYMOUS.
+
 2001-04-22  H.J. Lu <hjl@lucon.org>
 
        * nfs-utils.spec.in: Fix a typo.
index 3afd4f2940c0455af93975d55b39590a09389b0f..1fd42697f04ab812f5e6e858d7cc73b9cc32d08a 100644 (file)
@@ -239,12 +239,23 @@ client_check(nfs_client *clp, struct hostent *hp)
                {
                        char    *dot;
                        int     match;
+                       struct hostent *nhp = NULL;
+                       struct sockaddr_in addr;
 
                        /* First, try to match the hostname without
                         * splitting off the domain */
                        if (innetgr(cname+1, hname, 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),
+                           sizeof(addr.sin_addr), AF_INET))) {
+                               hname = (char *)nhp->h_name;
+                               if (innetgr(cname+1, hname, NULL, NULL))
+                                       return 1;
+                       }
+
                        /* Okay, strip off the domain (if we have one) */
                        if ((dot = strchr(hname, '.')) == NULL)
                                return 0;
@@ -291,7 +302,7 @@ client_gettype(char *ident)
 {
        char    *sp;
 
-       if (ident[0] == '\0')
+       if (ident[0] == '\0' || strcmp(ident, "*")==0)
                return MCL_ANONYMOUS;
        if (ident[0] == '@') {
 #ifndef HAVE_INNETGR