walters / rpms / nfs-utils

Forked from rpms/nfs-utils 6 years ago
Clone
cvsdist 4bc0e7f
#
cvsdist 4bc0e7f
# Make sure check_new_cache() is looking in the right place
cvsdist 4bc0e7f
#
cvsdist 4bc0e7f
--- src/support/nfs/cacheio.c.org	2003-08-04 00:12:16.000000000 -0400
cvsdist 4bc0e7f
+++ src/support/nfs/cacheio.c	2004-03-22 18:12:55.163534208 -0500
cvsdist 4bc0e7f
@@ -223,12 +223,23 @@ int readline(int fd, char **buf, int *le
cvsdist 4bc0e7f
  * This succeeds iff the "nfsd" filesystem is mounted on
cvsdist 4bc0e7f
  * /proc/fs/nfs
cvsdist 4bc0e7f
  */
cvsdist 4bc0e7f
+static char *cachelist[] = {
cvsdist 4bc0e7f
+	{ "auth.unix.ip" }, { "nfsd.export" }, { "nfsd.fh" }, 
cvsdist 4bc0e7f
+	{ NULL, NULL }
cvsdist 4bc0e7f
+};
cvsdist 4bc0e7f
 int
cvsdist 4bc0e7f
 check_new_cache(void)
cvsdist 4bc0e7f
 {
cvsdist 4bc0e7f
 	struct stat stb;
cvsdist 4bc0e7f
-	return	(stat("/proc/fs/nfs/filehandle", &stb) == 0) ||
cvsdist 4bc0e7f
-		(stat("/proc/fs/nfsd/filehandle", &stb) == 0);
cvsdist 4bc0e7f
+	char path[64];
cvsdist 4bc0e7f
+	int i;
cvsdist 4bc0e7f
+
cvsdist 4bc0e7f
+	for (i=0; cachelist[i]; i++ ){
cvsdist 4bc0e7f
+		sprintf(path, "/proc/net/rpc/%s/channel", cachelist[i]);
cvsdist 4bc0e7f
+		if (stat(path, &stb) < 0)
cvsdist 4bc0e7f
+			return 0;
cvsdist 4bc0e7f
+	}
cvsdist 4bc0e7f
+	return 1;
cvsdist 4bc0e7f
 }	
cvsdist 1ae9d4b
cvsdist 1ae9d4b
cvsdist 1ae9d4b
#
cvsdist 4999365
# Eliminate 3 syslog message that are logged for
cvsdist 1ae9d4b
# successful events.
cvsdist 1ae9d4b
#
cvsdist 1ae9d4b
--- src/utils/mountd/mountd.c.org	2003-09-12 18:14:16.000000000 -0400
cvsdist 1ae9d4b
+++ src/utils/mountd/mountd.c	2004-06-16 09:31:06.000000000 -0400
cvsdist 1ae9d4b
@@ -90,10 +90,11 @@ mount_dump_1_svc(struct svc_req *rqstp, 
cvsdist 1ae9d4b
 {
cvsdist 1ae9d4b
 	struct sockaddr_in *addr =
cvsdist 1ae9d4b
 		(struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
cvsdist 1ae9d4b
-	xlog(L_NOTICE, "dump request from %s",
cvsdist 1ae9d4b
-		inet_ntoa(addr->sin_addr));
cvsdist 1ae9d4b
 
cvsdist 1ae9d4b
-	*res = mountlist_list();
cvsdist 1ae9d4b
+	if ((*res = mountlist_list()) == NULL)
cvsdist 1ae9d4b
+		xlog(L_WARNING, "dump request from %s failed.",
cvsdist 1ae9d4b
+			inet_ntoa(addr->sin_addr));
cvsdist 1ae9d4b
+
cvsdist 1ae9d4b
 	return 1;
cvsdist 1ae9d4b
 }
cvsdist 1ae9d4b
 
cvsdist 1ae9d4b
@@ -143,9 +144,11 @@ mount_export_1_svc(struct svc_req *rqstp
cvsdist 1ae9d4b
 {
cvsdist 1ae9d4b
 	struct sockaddr_in *addr =
cvsdist 1ae9d4b
 		(struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
cvsdist 1ae9d4b
-	xlog(L_NOTICE, "export request from %s",
cvsdist 1ae9d4b
-		inet_ntoa(addr->sin_addr));
cvsdist 1ae9d4b
-	*resp = get_exportlist();
cvsdist 1ae9d4b
+
cvsdist 1ae9d4b
+	if ((*resp = get_exportlist()) == NULL)
cvsdist 1ae9d4b
+		xlog(L_WARNING, "export request from %s failed.",
cvsdist 1ae9d4b
+			inet_ntoa(addr->sin_addr));
cvsdist 1ae9d4b
+		
cvsdist 1ae9d4b
 	return 1;
cvsdist 1ae9d4b
 }
cvsdist 1ae9d4b
 
cvsdist 1ae9d4b
@@ -154,9 +157,10 @@ mount_exportall_1_svc(struct svc_req *rq
cvsdist 1ae9d4b
 {
cvsdist 1ae9d4b
 	struct sockaddr_in *addr =
cvsdist 1ae9d4b
 		(struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
cvsdist 1ae9d4b
-	xlog(L_NOTICE, "exportall request from %s",
cvsdist 1ae9d4b
-		inet_ntoa(addr->sin_addr));
cvsdist 1ae9d4b
-	*resp = get_exportlist();
cvsdist 1ae9d4b
+
cvsdist 1ae9d4b
+	if ((*resp = get_exportlist()) == NULL)
cvsdist 1ae9d4b
+		xlog(L_WARNING, "exportall request from %s failed.",
cvsdist 1ae9d4b
+			inet_ntoa(addr->sin_addr));
cvsdist 1ae9d4b
 	return 1;
cvsdist 1ae9d4b
 }
cvsdist 4bc0e7f