$NetBSD: patch-aq,v 1.1 2006/08/09 17:31:10 salo Exp $

Security fix for SA21402.

--- appl/bsd/krshd.c.orig	2005-04-07 23:17:25.000000000 +0200
+++ appl/bsd/krshd.c	2006-08-09 18:52:53.000000000 +0200
@@ -1379,9 +1379,15 @@ void doit(f, fromp)
      * If we're on a system which keeps track of login uids, then
      * set the login uid. 
      */
-    setluid((uid_t) pwd->pw_uid);
+    if (setluid((uid_t) pwd->pw_uid) < 0) {
+	perror("setluid");
+	_exit(1);
+    }
 #endif	/* HAVE_SETLUID */
-    (void) setuid((uid_t)pwd->pw_uid);
+    if (setuid((uid_t)pwd->pw_uid) < 0) {
+	perror("setuid");
+	_exit(1);
+    }
     /* if TZ is set in the parent, drag it in */
     {
       char **findtz = environ;
