rpms/rusers/devel netkit-rusers-0.17-rusersd-droppriv.patch, NONE, 1.1 rusers.spec, 1.26, 1.27

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


Author: steved

Update of /cvs/pkgs/rpms/rusers/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8329

Modified Files:
	rusers.spec 
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/devel/rusers.spec,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- rusers.spec	29 Aug 2007 04:33:59 -0000	1.26
+++ rusers.spec	17 Sep 2007 12:39:38 -0000	1.27
@@ -5,7 +5,7 @@
 Summary: Displays the users logged into machines on the local network.
 Name: rusers
 Version: 0.17
-Release: 50%{?dist}
+Release: 51%{?dist}
 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-51
+- Removed portmap dependency and re-worked when the user
+  privilege are drop; allowing port registration with
+  rpcbind. (#247985)
+
 * Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 0.17-50
 - Rebuild for selinux ppc32 issue.
 




More information about the fedora-extras-commits mailing list