rpms/rusers/F-7 netkit-rusers-0.17-rusersd-droppriv.patch, NONE, 1.1 rusers.spec, 1.23, 1.24 rusersd.init, 1.2, 1.3

Steve Dickson (steved) fedora-extras-commits at redhat.com
Mon Sep 17 12:24:59 UTC 2007


Author: steved

Update of /cvs/pkgs/rpms/rusers/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6871

Modified Files:
	rusers.spec rusersd.init 
Added Files:
	netkit-rusers-0.17-rusersd-droppriv.patch 
Log Message:
- Removed portmap dependency and re-worked when the user
  privilege are drop; allowing port registration with
  rpcbind. (#247985)


netkit-rusers-0.17-rusersd-droppriv.patch:

--- NEW FILE netkit-rusers-0.17-rusersd-droppriv.patch ---
diff -up netkit-rusers-0.17/rpc.rusersd/rusersd.c.orig netkit-rusers-0.17/rpc.rusersd/rusersd.c
--- netkit-rusers-0.17/rpc.rusersd/rusersd.c.orig	2000-07-23 00:09:28.000000000 -0400
+++ netkit-rusers-0.17/rpc.rusersd/rusersd.c	2007-09-15 06:30:12.000000000 -0400
@@ -74,23 +74,6 @@ main(void)
  
 	/* Open syslog */
 	openlog("rpc.rusersd", LOG_PID, LOG_DAEMON);
- 
-	/* Drop privilege */
-	if (getuid() == 0) {
-		struct passwd	*pw;
- 
-		if ((pw = getpwnam("nobody")) == NULL) {
-			syslog(LOG_WARNING, "Unable to find user nobody: %m");
-			exit(1);
-		}
-		if (setgroups(1, &pw->pw_gid) < 0
-		 || setgid(pw->pw_gid) < 0
-		 || setuid(pw->pw_uid) < 0) {
-			syslog(LOG_WARNING, "Failed to drop privilege: %m");
-			exit(1);
-		}
-	}
- 
 	
 	/*
 	 * See if inetd started us
@@ -128,6 +111,23 @@ main(void)
 		syslog(LOG_ERR, "unable to register (RUSERSPROG, RUSERSVERS_IDLE, %s).", proto?"udp":"(inetd)");
 		exit(1);
 	}
+ 
+	/* Drop privilege */
+	if (getuid() == 0) {
+		struct passwd	*pw;
+ 
+		if ((pw = getpwnam("nobody")) == NULL) {
+			syslog(LOG_WARNING, "Unable to find user nobody: %m");
+			exit(1);
+		}
+		if (setgroups(1, &pw->pw_gid) < 0
+		 || setgid(pw->pw_gid) < 0
+		 || setuid(pw->pw_uid) < 0) {
+			syslog(LOG_WARNING, "Failed to drop privilege: %m");
+			exit(1);
+		}
+	}
+ 
 
 	svc_run();
 	syslog(LOG_ERR, "svc_run returned");


Index: rusers.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rusers/F-7/rusers.spec,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- rusers.spec	9 Aug 2006 12:39:57 -0000	1.23
+++ rusers.spec	17 Sep 2007 12:24:27 -0000	1.24
@@ -5,7 +5,7 @@
 Summary: Displays the users logged into machines on the local network.
 Name: rusers
 Version: 0.17
-Release: 47
+Release: 48
 License: BSD
 Group: System Environment/Daemons
 Source: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-rusers-%{version}.tar.gz
@@ -27,6 +27,7 @@
 Patch12: netkit-rusers-0.17-bigendian.patch
 Patch13: netkit-rusers-0.17-return.patch
 Patch14: netkit-rusers-0.17-procdiskstats.patch
+Patch15: netkit-rusers-0.17-rusersd-droppriv.patch
 Buildroot: %{_tmppath}/%{name}-root
 BuildRequires: procps libselinux-devel
 
@@ -72,6 +73,7 @@
 %patch12 -p1 -b .bigendian
 %patch13 -p1 -b .return
 %patch14 -p1 -b .procdiskstats
+%patch15 -p1 -b .dropprivs
 
 %build
 cat > MCONFIG <<EOF
@@ -144,6 +146,11 @@
 %config /etc/rc.d/init.d/rstatd
 
 %changelog
+* Sat Sep 15 2007 Steve Dickson <steved at redaht.com> 0.17.48
+- Removed portmap dependency and re-worked when the user
+  privilege are drop; allowing port registration with
+  rpcbind. (#247985)
+
 * Wed Aug 09 2006 Phil Knirsch <pknirsch at redhat.com> 0.17-47
 - Modified the RHEL3 procpartitions patch to work on recent 2.6 kernels (#201839)
 


Index: rusersd.init
===================================================================
RCS file: /cvs/pkgs/rpms/rusers/F-7/rusersd.init,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rusersd.init	9 Sep 2004 11:56:00 -0000	1.2
+++ rusersd.init	17 Sep 2007 12:24:27 -0000	1.3
@@ -20,9 +20,6 @@
 RETVAL=0
 
 start() {
-	status portmap > /dev/null
-	RETVAL=$?
-	[ $RETVAL -ne 0 ] && /etc/rc.d/init.d/portmap start
 	echo -n $"Starting rusers services: "
 	daemon rpc.rusersd
 	RETVAL=$?




More information about the scm-commits mailing list