From 4d961554071d2308017062c8bc39f37f5de55b5f Mon Sep 17 00:00:00 2001 From: neilbrown Date: Thu, 20 Sep 2001 00:10:49 +0000 Subject: call gethostbyaddr to make sure that we have canonical hostname for all exports --- utils/exportfs/exportfs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'utils/exportfs/exportfs.c') 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); -- cgit