Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/fs/tmpfs Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/efbb685469be
branches:  netbsd-7
changeset: 798732:efbb685469be
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Dec 22 02:05:08 2014 +0000

description:
Pull up following revision(s) (requested by gson in ticket #344):
        sys/fs/tmpfs/tmpfs_vnops.c: revision 1.121
        sys/fs/tmpfs/tmpfs_subr.c: revision 1.97
Store symlinks without a NUL terminator so that lstat(2) returns the
correct length.  Fixes the tmpfs part of PR kern/48864.

diffstat:

 sys/fs/tmpfs/tmpfs_subr.c  |  5 ++---
 sys/fs/tmpfs/tmpfs_vnops.c |  6 +++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diffs (53 lines):

diff -r d057bb688d47 -r efbb685469be sys/fs/tmpfs/tmpfs_subr.c
--- a/sys/fs/tmpfs/tmpfs_subr.c Mon Dec 22 01:59:14 2014 +0000
+++ b/sys/fs/tmpfs/tmpfs_subr.c Mon Dec 22 02:05:08 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_subr.c,v 1.96 2014/01/23 10:13:56 hannken Exp $  */
+/*     $NetBSD: tmpfs_subr.c,v 1.96.4.1 2014/12/22 02:05:08 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2005-2013 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.96 2014/01/23 10:13:56 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.96.4.1 2014/12/22 02:05:08 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/cprng.h>
@@ -185,7 +185,6 @@
                }
 
                KASSERT(nnode->tn_size < MAXPATHLEN);
-               nnode->tn_size++; /* include the NUL terminator */
 
                nnode->tn_spec.tn_lnk.tn_link =
                    tmpfs_strname_alloc(tmp, nnode->tn_size);
diff -r d057bb688d47 -r efbb685469be sys/fs/tmpfs/tmpfs_vnops.c
--- a/sys/fs/tmpfs/tmpfs_vnops.c        Mon Dec 22 01:59:14 2014 +0000
+++ b/sys/fs/tmpfs/tmpfs_vnops.c        Mon Dec 22 02:05:08 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_vnops.c,v 1.120 2014/07/25 08:20:52 dholland Exp $       */
+/*     $NetBSD: tmpfs_vnops.c,v 1.120.2.1 2014/12/22 02:05:08 msaitoh Exp $    */
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.120 2014/07/25 08:20:52 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.120.2.1 2014/12/22 02:05:08 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/dirent.h>
@@ -1036,7 +1036,7 @@
        /* Note: readlink(2) returns the path without NUL terminator. */
        if (node->tn_size > 0) {
                error = uiomove(node->tn_spec.tn_lnk.tn_link,
-                   MIN(node->tn_size - 1, uio->uio_resid), uio);
+                   MIN(node->tn_size, uio->uio_resid), uio);
        } else {
                error = 0;
        }



Home | Main Index | Thread Index | Old Index