summaryrefslogtreecommitdiffstats
path: root/utils/exportfs
diff options
context:
space:
mode:
authorneilbrown <neilbrown>2001-09-20 00:10:49 +0000
committerneilbrown <neilbrown>2001-09-20 00:10:49 +0000
commit4d961554071d2308017062c8bc39f37f5de55b5f (patch)
treed7cff7e32ac200615806b085b2d9ce0deac52423 /utils/exportfs
parent8d53a2630763f8f639d2de2ddd26282bff1c7cad (diff)
downloadnfs-utils-4d961554071d2308017062c8bc39f37f5de55b5f.tar.gz
nfs-utils-4d961554071d2308017062c8bc39f37f5de55b5f.tar.xz
nfs-utils-4d961554071d2308017062c8bc39f37f5de55b5f.zip
call gethostbyaddr to make sure that we have canonical hostname
for all exports
Diffstat (limited to 'utils/exportfs')
-rw-r--r--utils/exportfs/exportfs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
index 0504709..c012961 100644
--- a/utils/exportfs/exportfs.c
+++ b/utils/exportfs/exportfs.c
@@ -228,7 +228,14 @@ exportfs(char *arg, char *options, int verbose)
if ((htype = client_gettype(hname)) == MCL_FQDN &&
(hp = gethostbyname(hname)) != NULL) {
- hp = hostent_dup (hp);
+ struct hostent *hp2 = hostent_dup (hp);
+ hp = gethostbyaddr(hp2->h_addr, hp2->h_length,
+ hp2->h_addrtype);
+ if (hp) {
+ free(hp2);
+ hp = hostent_dup(hp);
+ } else
+ hp = hp2;
exp = export_find(hp, path);
} else {
exp = export_lookup(hname, path);