Re: nfs is stupid ("getfh failed")

Neil Brown (neilb@cse.unsw.edu.au)
Tue, 11 Sep 2001 20:01:14 +1000 (EST)


On Tuesday September 11, lk@tantalophile.demon.co.uk wrote:
>
> Yes, I'm doing the second of those. No alternative -- I need write
> access from some hosts, and read access to all the rest (who are
> dynamically allocated) on the subnet.
>
> It's clearly a bug in the NFS server then.

Actually, it's a bug in nfs-utils, that I have a patch for, but
haven't got arround to commiting it to the CVS on sourceforge yet.

NeilBrown

Index: utils/mountd/auth.c
===================================================================
RCS file: /cvsroot/nfs/nfs-utils/utils/mountd/auth.c,v
retrieving revision 1.6
diff -u -r1.6 auth.c
--- utils/mountd/auth.c 2000/11/27 23:46:35 1.6
+++ utils/mountd/auth.c 2001/07/24 10:38:37
@@ -78,20 +78,10 @@
}
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 @@
*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;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/