From 3be9d767afb30d770d4963e41cc4117c8b9b2f54 Mon Sep 17 00:00:00 2001
From: Unknown <root@fawkes.sourcemage.org>
Date: Mon, 24 Apr 2006 09:03:08 -0500
Subject: [PATCH 03/23] shutdown: Fix minimum UID to kill

[ismael@sourcemage.org: Add proper commit message]

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
---
 login-utils/shutdown.8 | 2 +-
 login-utils/shutdown.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/login-utils/shutdown.8 b/login-utils/shutdown.8
index a84454b56dc3..266e8a082528 100644
--- a/login-utils/shutdown.8
+++ b/login-utils/shutdown.8
@@ -64,7 +64,7 @@ writes the shutdown time into the
 .I /var/log/wtmp
 file and terminates all processes as follows: 
 
-It kills (SIGTERM) all non-privileged (uid>=100) processes on the system,
+It kills (SIGTERM) all non-privileged (uid>=1000) processes on the system,
 executes \fBfinalprog\fP as specified in \fI/etc/inittab\fP (see
 .BR init (8) 
 ) with the argument "stop", tells
diff --git a/login-utils/shutdown.c b/login-utils/shutdown.c
index ba74121dc8ba..ee6ebb087847 100644
--- a/login-utils/shutdown.c
+++ b/login-utils/shutdown.c
@@ -413,7 +413,7 @@ main(int argc, char *argv[])
 #ifndef DEBUGGING
 	my_puts ("");
 	my_puts ("");                 /*  Get past the login prompt         */
-	/* a gentle kill of all other processes except those with uid>=100 */
+	/* a gentle kill of all other processes except those with uid>=1000 */
 	/* the message stating this is in kill_mortals() because it is */
 	/* only printed if some processes are actually killed.*/
 	kill_mortals (SIGTERM);
@@ -789,7 +789,7 @@ static void kill_mortals (int sig)
 	pid = atoi (de->d_name);
 	sprintf (path, "/proc/%d", pid);
 	if (stat (path, &statbuf) != 0) continue;
-	if (statbuf.st_uid < 100) continue;
+	if (statbuf.st_uid < 1000) continue;
 	if (index >= npids)
 	{
 	    pids2 = realloc (pids, (npids+4096)*sizeof(pid_t));
@@ -801,7 +801,7 @@ static void kill_mortals (int sig)
     }
     closedir (dp);
     if (pids == NULL) return;
-    my_puts ("Sending TERM signal to processes with UID>=100...");
+    my_puts ("Sending TERM signal to processes with UID>=1000...");
     for (--index; index >= 0; --index) kill (pids[index], sig);
     free (pids);
 }   /*  End Function kill_mortals  */
-- 
2.44.0

