lkml.org 
[lkml]   [1997]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject2.1.20 ext2fs readlink bug+fix
Hi,

In Linux kernel 2.1.20, readlink() on an ext2 file system returns one plus the
length of the link target. Previous kernels and other UNIXes I've checked
return exactly the length of the link target.

Here's a patch to revert to the original behavior:

--- linux/fs/ext2/symlink.c.orig Fri Jan 3 21:19:25 1997
+++ linux/fs/ext2/symlink.c Sun Jan 5 01:18:10 1997
@@ -124,7 +124,7 @@
link = (char *) inode->u.ext2_i.i_data;

/* XXX I hope link is always '\0'-terminated. */
- i = strlen(link)+1;
+ i = strlen(link);
if (i > buflen)
i = buflen;
if (copy_to_user(buffer, link, i))
Nick Duffek
nsd@bbc.com

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.033 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site