summaryrefslogtreecommitdiffstats
path: root/utils/mountd/auth.c
diff options
context:
space:
mode:
authorneilbrown <neilbrown>2001-09-12 02:05:39 +0000
committerneilbrown <neilbrown>2001-09-12 02:05:39 +0000
commit5b9179e1d135ef4341516465222eaf9efb84c5f3 (patch)
treebdef4739986dc2d07609faa4781a0953ca34b7e9 /utils/mountd/auth.c
parente7a90e99053a6c0575efcb19f3ddda3abd5f59cd (diff)
downloadnfs-utils-5b9179e1d135ef4341516465222eaf9efb84c5f3.tar.gz
nfs-utils-5b9179e1d135ef4341516465222eaf9efb84c5f3.tar.xz
nfs-utils-5b9179e1d135ef4341516465222eaf9efb84c5f3.zip
* utils/mountd/auth.c (auth_authenticate_internal): Reverse
change from 2000-08-02: It causes problems if someone exports to both a hostname and IP addresses. nfs-utils must be consistant about the canonical name that it chooses.
Diffstat (limited to 'utils/mountd/auth.c')
-rw-r--r--utils/mountd/auth.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c
index 6b6b7d7..d88c46f 100644
--- a/utils/mountd/auth.c
+++ b/utils/mountd/auth.c
@@ -78,20 +78,10 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller,
}
auth_fixpath(path);
- /* First try it w/o doing a hostname lookup... */
- *hpp = get_hostent((const char *)&addr, sizeof(addr), AF_INET);
- exp = export_find(*hpp, path);
-
- if (!exp) {
- /* Ok, that didn't fly. Try it with a reverse lookup. */
- free (*hpp);
- *hpp = gethostbyaddr((const char *)&addr, sizeof(addr),
- AF_INET);
- if (!(*hpp)) {
- *error = no_entry;
- *hpp = get_hostent((const char *)&addr, sizeof(addr), AF_INET);
- return NULL;
- } else {
+ if (!(*hpp = gethostbyaddr((const char *)&addr, sizeof(addr), AF_INET)))
+ *hpp = get_hostent((const char *)&addr, sizeof(addr),
+ AF_INET);
+ else {
/* must make sure the hostent is authorative. */
char **sp;
struct hostent *forward = NULL;
@@ -123,14 +113,12 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller,
*error = no_forward_dns;
return NULL;
}
- }
+ }
- if (!(exp = export_find(*hpp, path))) {
+ if (!(exp = export_find(*hpp, path))) {
*error = no_entry;
return NULL;
- }
}
-
if (!exp->m_mayexport) {
*error = not_exported;
return NULL;