Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/kern Pull up revision 1.152 (requested by christos):



details:   https://anonhg.NetBSD.org/src/rev/ac1434b40e39
branches:  netbsd-1-5
changeset: 493090:ac1434b40e39
user:      he <he%NetBSD.org@localhost>
date:      Fri Apr 26 17:51:39 2002 +0000

description:
Pull up revision 1.152 (requested by christos):
  If a set{u,g}id binary is invoked with fd < 3 closed, open those
  file desciptors to /dev/null.

diffstat:

 sys/kern/kern_exec.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 26bac3beeb80 -r ac1434b40e39 sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c      Fri Apr 26 17:51:19 2002 +0000
+++ b/sys/kern/kern_exec.c      Fri Apr 26 17:51:39 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exec.c,v 1.110.4.7 2002/01/14 10:49:30 he Exp $   */
+/*     $NetBSD: kern_exec.c,v 1.110.4.8 2002/04/26 17:51:39 he Exp $   */
 
 /*-
  * Copyright (C) 1993, 1994, 1996 Christopher G. Demetriou
@@ -516,6 +516,10 @@
                 */
                p_sugid(p);
 
+               /* Make sure file descriptors 0..2 are in use. */
+               if ((error = fdcheckstd(p)) != 0)
+                       goto exec_abort;
+
                p->p_ucred = crcopy(cred);
 #ifdef KTRACE
                /*



Home | Main Index | Thread Index | Old Index