- if (path[0] != '/') {
- *error = bad_path;
- return NULL;
- }
- auth_fixpath(path);
-
- 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;
- char *tmpname;
-
- tmpname = xstrdup((*hpp)->h_name);
- if (tmpname) {
- forward = gethostbyname(tmpname);
- free(tmpname);
- }
- if (forward) {
- /* now make sure the "addr" is in the list */
- for (sp = forward->h_addr_list ; *sp ; sp++) {
- if (memcmp(*sp, &addr, forward->h_length)==0)
- break;
- }
-
- if (!*sp) {
- /* it was a FAKE */
- *error = faked_hostent;
- *hpp = hostent_dup (*hpp);
- return NULL;
+ if (new_cache) {
+ int i;
+ /* return static nfs_export with details filled in */
+ char *n;
+ my_client.m_addrlist[0] = caller->sin_addr;
+ n = client_compose(caller->sin_addr);
+ *error = unknown_host;
+ if (!n)
+ return NULL;
+ strcpy(my_client.m_hostname, *n?n:"DEFAULT");
+ free(n);
+ my_client.m_naddr = 1;
+ my_exp.m_client = &my_client;
+
+ exp = NULL;
+ for (i = 0; !exp && i < MCL_MAXTYPES; i++)
+ for (exp = exportlist[i]; exp; exp = exp->m_next) {
+ if (!client_member(my_client.m_hostname, exp->m_client->m_hostname))
+ continue;
+ if (strcmp(path, exp->m_export.e_path))
+ continue;
+ break;