Skip to contentSkip to conversation

SGI 902615: make nohide export option work with wildcard exports

PATCH New Greg Banks 1 participant 1 message Sep 23, 2004

Subsystems (2)
lore
Share & tools
lore

Greg Banks

author
#0 lore raw

PATCH 1/1 SGI 902615: make nohide export option work with wildcard exports

G'day,

This patch has been sitting around gathering dust for some months, I recently updated and tested it. It changes rpc.mountd to make the "nohide" export option work with 2.4 kernels or if the nfsd filesystem isn't mounted, by pre-loading into the kernel and xtab at mount time all the nohide exports which are enclosed by the export being mounted.

---
 ChangeLog             |    5 ++
 utils/mountd/auth.c   |   47 ++++++++++++-----------
 utils/mountd/mountd.c |  102 ++++++++++++++++++++++++++++++++++++++++++++++++--
 utils/mountd/mountd.h |   14 ++++++
 utils/mountd/rmtab.c  |    2 
 5 files changed, 144 insertions(+), 26 deletions(-)
ChangeLog +5 -0
diff -Napur --exclude-from=nfs-utils.excludes nfs-utils-1.0.6.orig/ChangeLog nfs-utils-1.0.6/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-21 Greg Banks <[email protected]>
+
+	* utils/mountd/auth.c, utils/mountd/mountd.c, utils/mountd/mountd.h:
+	Support "nohide" export option on wildcard export entries.
+
 2003-09-15 NeilBrown <[email protected]>
 
 	Release 1.0.6
utils/mountd/auth.c +26 -21

79 lines not on this page · raw message

utils/mountd/mountd.c +99 -3

150 lines not on this page · raw message

utils/mountd/mountd.h +13 -1
diff -Napur --exclude-from=nfs-utils.excludes nfs-utils-1.0.6.orig/utils/mountd/mountd.h nfs-utils-1.0.6/utils/mountd/mountd.h
@@ -25,6 +25,17 @@ union mountd_results {
 	exports			exports;
 };
 
+/* used internally only */
+enum auth_error
+{
+  bad_path,
+  unknown_host,
+  no_entry,
+  not_exported,
+  illegal_port,
+  success
+};
+
 /*
  * Global Function prototypes.
  */
@@ -42,7 +53,8 @@ void		mount_dispatch(struct svc_req *, S
 void		auth_init(char *export_file);
 int		auth_reload(void);
 nfs_export *	auth_authenticate(char *what, struct sockaddr_in *sin,
-					char *path);
+					char *path, struct hostent **hpp);
+enum auth_error auth_authenticate_export(nfs_export *exp, struct sockaddr_in *);
 void		auth_export(nfs_export *exp);
 
 void		mountlist_add(char *host, const char *path);
utils/mountd/rmtab.c +1 -1
diff -Napur --exclude-from=nfs-utils.excludes nfs-utils-1.0.6.orig/utils/mountd/rmtab.c nfs-utils-1.0.6/utils/mountd/rmtab.c
@@ -150,7 +150,7 @@ mountlist_del_all(struct sockaddr_in *si
 	}
 	while ((rep = getrmtabent(1, NULL)) != NULL) {
 		if (strcmp(rep->r_client, hp->h_name) == 0 &&
-		    (exp = auth_authenticate("umountall", sin, rep->r_path))) {
+		    (exp = auth_authenticate("umountall", sin, rep->r_path, NULL))) {
 			export_reset(exp);
 			continue;
 		}

Greg.

Signature · 12 lines
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs