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.28 -> 1.29, approved by Perry.



details:   https://anonhg.NetBSD.org/src/rev/d4db4e9b92a8
branches:  netbsd-1-4
changeset: 468109:d4db4e9b92a8
user:      wrstuden <wrstuden%NetBSD.org@localhost>
date:      Wed Apr 07 19:07:29 1999 +0000

description:
Pull up revision 1.28 -> 1.29, approved by Perry.

Here's the revised commit message from 1.29:

Fix obscure bug in namei(), which was the cause of PR 7306.

The problem is that if "sl" is a symbolic link, a lookup on "sl/"
will be flagged as the last component. Thus VOP_LOOKUP will lock
the parent directory if LOCKPARENT is set. In order for the symbolic
link to be resolved, this lock needs to be released. namei() would
test for this by checking if ni_pathlen == 1, which it wouldn't as
"/" is left in the name, and namei() would not unlock the parent.
The next call to lookup() to resolve the symbolic link would fail
as the parent was still locked.

diffstat:

 sys/kern/vfs_lookup.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 9fb6e6a90d4b -r d4db4e9b92a8 sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c     Wed Apr 07 17:24:02 1999 +0000
+++ b/sys/kern/vfs_lookup.c     Wed Apr 07 19:07:29 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_lookup.c,v 1.28 1998/08/04 04:03:19 perry Exp $    */
+/*     $NetBSD: vfs_lookup.c,v 1.28.6.1 1999/04/07 19:07:29 wrstuden Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -164,7 +164,7 @@
                                cnp->cn_flags |= HASBUF;
                        return (0);
                }
-               if ((cnp->cn_flags & LOCKPARENT) && ndp->ni_pathlen == 1)
+               if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_flags & ISLASTCN))
                        VOP_UNLOCK(ndp->ni_dvp, 0);
                if (ndp->ni_loopcnt++ >= MAXSYMLINKS) {
                        error = ELOOP;



Home | Main Index | Thread Index | Old Index