broken extraction/viewing fix from tarfs


this patch fixes broken extraction and displaying of symlinks from
tarfs, but possibly affects any vfs that uses vfs_s_readlink ().

To see description and steps to reproduce please see:

In vfs_s_readlink () there is incorrectly calculated length of buf
instead of link name in the inode. The random size you may see when
extracting symlinks from tarfs is caused by the fact that buf is mostly
uninitialized so the link is truncated almost at random position.

Jindrich Novy <jnovy redhat com>,
--- mc-4.6.1-20041129/vfs/direntry.c.jn	2004-11-26 13:00:36.000000000 +0100
+++ mc-4.6.1-20041129/vfs/direntry.c	2004-11-29 16:25:57.746674304 +0100
@@ -700,7 +700,7 @@ vfs_s_readlink (struct vfs_class *me, co
     if (ino->linkname == NULL)
-    len = strlen (buf);
+    len = strlen (ino->linkname);
     if (size < len)
        len = size;
     /* readlink() does not append a NUL character to buf */

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]