Skip to contentSkip to conversation

nfs-utils 9 of 10 - Fixed some security issues found by SGI

PATCH New Steve Dickson 1 participant 1 message Sep 23, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs-utils 9 of 10 - Fixed some security issues found by SGI

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

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

---------

utils/statd/monitor.c renamed from utils/statd/monitor.c.sgi +2 -1
@@ -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;
utils/statd/statd.c renamed from utils/statd/statd.c.sgi +3 -1
@@ -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",
utils/statd/svc_run.c renamed from utils/statd/svc_run.c.sgi +2 -1
@@ -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: