diff options
author | hjl <hjl> | 2001-05-07 00:54:18 +0000 |
---|---|---|
committer | hjl <hjl> | 2001-05-07 00:54:18 +0000 |
commit | 86ae664e66c439354cb4f959e9f289059e7760a4 (patch) | |
tree | 2b5a83baa6f2c63f951bb52888c1d7f0f2e5d1e5 /support/export/client.c | |
parent | 0a1909eece7100a5e4c91d371c296fe60872a0d0 (diff) | |
download | nfs-utils-86ae664e66c439354cb4f959e9f289059e7760a4.tar.gz nfs-utils-86ae664e66c439354cb4f959e9f289059e7760a4.tar.xz nfs-utils-86ae664e66c439354cb4f959e9f289059e7760a4.zip |
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.
Diffstat (limited to 'support/export/client.c')
-rw-r--r-- | support/export/client.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/support/export/client.c b/support/export/client.c index 3afd4f2..1fd4269 100644 --- a/support/export/client.c +++ b/support/export/client.c @@ -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 |