SOURCES: distcache-setuid.patch (NEW) - from centos src.rpm

glen glen at pld-linux.org
Wed Dec 14 13:33:23 CET 2005


Author: glen                         Date: Wed Dec 14 12:33:23 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- from centos src.rpm

---- Files affected:
SOURCES:
   distcache-setuid.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/distcache-setuid.patch
diff -u /dev/null SOURCES/distcache-setuid.patch:1.1
--- /dev/null	Wed Dec 14 13:33:23 2005
+++ SOURCES/distcache-setuid.patch	Wed Dec 14 13:33:17 2005
@@ -0,0 +1,33 @@
+
+Fix dc_client: don't go setuid until after the pidfile has been written.
+
+--- distcache-1.4.5/sessclient/sclient.c.setuid
++++ distcache-1.4.5/sessclient/sclient.c
+@@ -267,13 +267,6 @@
+ 	if(sockperms && !NAL_LISTENER_set_fs_perms(listener, sockperms))
+ 		SYS_fprintf(SYS_stderr, "Warning, can't set socket permissions "
+ 				"to '%s', continuing anyway\n", sockperms);
+-	if(user) {
+-		if(!SYS_setuid(user)) {
+-			SYS_fprintf(SYS_stderr, "Error, couldn't become user "
+-				    "'%s'.\n", user);
+-			return 1;
+-		}
+-	}
+ #endif
+ 
+ 	/* Define a "now" value that can be used during initialisation and
+@@ -312,6 +305,13 @@
+ 		SYS_fprintf(fp, "%lu", (unsigned long)SYS_getpid());
+ 		fclose(fp);
+ 	}
++	if(user) {
++		if(!SYS_setuid(user)) {
++			SYS_fprintf(SYS_stderr, "Error, couldn't become user "
++				    "'%s'.\n", user);
++			return 1;
++		}
++	}
+ #endif
+ 
+ 	/* Choose an appropriate select timeout relative to the retry period */
================================================================



More information about the pld-cvs-commit mailing list