X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=support%2Fexport%2Fclient.c;h=6236561465f26261175b290276abeb10c39de0bd;hb=6295bb04c73403a219bc96cc6770fc96bec19ba6;hp=1cb242f33fa62b993695df7c8623c7d9d9318a45;hpb=6826dcf4e9e00f466ecaeeb8369dc7308df36a86;p=nfs-utils.git diff --git a/support/export/client.c b/support/export/client.c index 1cb242f..6236561 100644 --- a/support/export/client.c +++ b/support/export/client.c @@ -297,7 +297,7 @@ name_cmp(char *a, char *b) /* compare strings a and b, but only upto ',' in a */ while (*a && *b && *a != ',' && *a == *b) a++, b++; - if (!*b && (!*a || !a == ',') ) + if (!*b && (!*a || *a == ',')) return 0; if (!*b) return 1; if (!*a || *a == ',') return -1; @@ -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),