All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs-utils 9 of 10 - Fixed some security issues found by SGI
@ 2005-09-23 14:49 Steve Dickson
  0 siblings, 0 replies; only message in thread
From: Steve Dickson @ 2005-09-23 14:49 UTC (permalink / raw)
  To: nfs

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: nfs-utils-1.0.7-sgi-statd-fixes.patch --]
[-- Type: text/x-patch, Size: 1849 bytes --]

Fixed some security issues found by SGI (bz# 133556)

Details can be found in:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=133556

Signed-off-by: Steve Dickson <steved@redhat.com>
---------
--- nfs-utils-1.0.7/utils/statd/monitor.c.sgi	2004-09-14 23:08:01.000000000 -0400
+++ nfs-utils-1.0.7/utils/statd/monitor.c	2005-02-21 11:32:06.558972064 -0500
@@ -15,6 +15,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <errno.h>
 #include <arpa/inet.h>
 #include "misc.h"
 #include "statd.h"
@@ -172,7 +173,7 @@ sm_mon_1_svc(struct mon *argp, struct sv
 	sprintf(path, "%s/%s", SM_DIR, mon_name);
 	if ((fd = open(path, O_WRONLY|O_SYNC|O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
 		/* Didn't fly.  We won't monitor. */
-		note(N_ERROR, "creat(%s) failed: %m", path);
+		note(N_ERROR, "creat(%s) failed: %s", path, strerror (errno));
 		nlist_free(NULL, clnt);
 		free(path);
 		goto failure;
--- nfs-utils-1.0.7/utils/statd/statd.c.sgi	2004-12-05 20:25:27.000000000 -0500
+++ nfs-utils-1.0.7/utils/statd/statd.c	2005-02-21 11:32:06.561971608 -0500
@@ -194,8 +194,10 @@ static void drop_privs(void)
 	struct stat st;
 
 	if (stat(SM_DIR, &st) == -1 &&
-	    stat(DIR_BASE, &st) == -1)
+	    stat(DIR_BASE, &st) == -1) {
 		st.st_uid = 0;
+		st.st_gid = 0;
+	}
 
 	if (st.st_uid == 0) {
 		note(N_WARNING, "statd running as root. chown %s to choose different user\n",
--- nfs-utils-1.0.7/utils/statd/svc_run.c.sgi	2004-12-05 20:25:28.000000000 -0500
+++ nfs-utils-1.0.7/utils/statd/svc_run.c	2005-02-21 11:32:06.562971456 -0500
@@ -123,7 +123,8 @@ my_svc_run(void)
 			if (errno == EINTR || errno == ECONNREFUSED
 			 || errno == ENETUNREACH || errno == EHOSTUNREACH)
 				continue;
-			note(N_ERROR, "my_svc_run() - select: %m");
+			note(N_ERROR, "my_svc_run() - select: %s",
+				strerror (errno));
 			return;
 
 		case 0:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-23 14:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-23 14:49 [PATCH] nfs-utils 9 of 10 - Fixed some security issues found by SGI Steve Dickson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.