Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/kern Pull up revision 1.38:



details:   https://anonhg.NetBSD.org/src/rev/91c28c304a30
branches:  netbsd-1-4
changeset: 469324:91c28c304a30
user:      he <he%NetBSD.org@localhost>
date:      Fri Sep 03 08:48:54 1999 +0000

description:
Pull up revision 1.38:
  Don't allow coredump to follow symlinks, this has security
  implications.  (bouyer)

diffstat:

 sys/kern/vfs_vnops.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 6b7480147337 -r 91c28c304a30 sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c      Fri Sep 03 08:45:35 1999 +0000
+++ b/sys/kern/vfs_vnops.c      Fri Sep 03 08:48:54 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_vnops.c,v 1.36 1999/03/31 18:30:13 mycroft Exp $   */
+/*     $NetBSD: vfs_vnops.c,v 1.36.2.1 1999/09/03 08:48:54 he Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -85,7 +85,8 @@
        if (fmode & O_CREAT) {
                ndp->ni_cnd.cn_nameiop = CREATE;
                ndp->ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF;
-               if ((fmode & O_EXCL) == 0)
+               if ((fmode & O_EXCL) == 0 &&
+                   ((fmode & FNOSYMLINK) == 0))
                        ndp->ni_cnd.cn_flags |= FOLLOW;
                if ((error = namei(ndp)) != 0)
                        return (error);
@@ -114,6 +115,10 @@
                                error = EEXIST;
                                goto bad;
                        }
+                       if (ndp->ni_vp->v_type == VLNK) {
+                               error = EFTYPE;
+                               goto bad;
+                       }
                        fmode &= ~O_CREAT;
                }
        } else {



Home | Main Index | Thread Index | Old Index