Source-Changes-HG archive

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

[src/netbsd-6]: src/lib/libperfuse Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/1b9f30f80e10
branches:  netbsd-6
changeset: 776748:1b9f30f80e10
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Nov 03 19:31:39 2014 +0000

description:
Pull up following revision(s) (requested by manu in ticket #1144):
        lib/libperfuse/ops.c: revision 1.70
We used to remove the trailing zeros in FUSE readlink replies, but
it seems it does not always happen. Just remove them if present.

diffstat:

 lib/libperfuse/ops.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r c1e3decf77da -r 1b9f30f80e10 lib/libperfuse/ops.c
--- a/lib/libperfuse/ops.c      Mon Nov 03 19:26:02 2014 +0000
+++ b/lib/libperfuse/ops.c      Mon Nov 03 19:31:39 2014 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.50.2.8 2014/11/03 19:18:09 msaitoh Exp $ */
+/*  $NetBSD: ops.c,v 1.50.2.9 2014/11/03 19:31:39 msaitoh Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -2623,12 +2623,16 @@
        if (len == 0)
                DERRX(EX_PROTOCOL, "path len = %zd too short", len);
                
+       (void)memcpy(linkname, _GET_OUTPAYLOAD(ps, pm, char *), len);
+
        /*
         * FUSE filesystems return a NUL terminated string, we 
-        * do not want to trailing \0
+        * do not want the trailing \0
         */
-       *linklen = len - 1;
-       (void)memcpy(linkname, _GET_OUTPAYLOAD(ps, pm, char *), len);
+       while (len > 0 && linkname[len - 1] == '\0')
+               len--;
+
+       *linklen = len;
 
        ps->ps_destroy_msg(pm);
        error = 0;



Home | Main Index | Thread Index | Old Index