Skip to content

Commit

Permalink
[PATCH] v9fs: symlink support fixes
Browse files Browse the repository at this point in the history
Two symlink fixes, v9fs_readlink didn't copy the last character of the
symlink name, v9fs_vfs_follow_link incorrectly called strlen of newly
allocated buffer instead of PATH_MAX.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Latchesar Ionkov authored and Linus Torvalds committed Feb 3, 2006
1 parent 8e75f74 commit 93c615f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,8 @@ static int v9fs_readlink(struct dentry *dentry, char *buffer, int buflen)
}

/* copy extension buffer into buffer */
if (fcall->params.rstat.stat.extension.len < buflen)
buflen = fcall->params.rstat.stat.extension.len;
if (fcall->params.rstat.stat.extension.len+1 < buflen)
buflen = fcall->params.rstat.stat.extension.len + 1;

memcpy(buffer, fcall->params.rstat.stat.extension.str, buflen - 1);
buffer[buflen-1] = 0;
Expand Down Expand Up @@ -951,7 +951,7 @@ static void *v9fs_vfs_follow_link(struct dentry *dentry, struct nameidata *nd)
if (!link)
link = ERR_PTR(-ENOMEM);
else {
len = v9fs_readlink(dentry, link, strlen(link));
len = v9fs_readlink(dentry, link, PATH_MAX);

if (len < 0) {
__putname(link);
Expand Down

0 comments on commit 93c615f

Please sign in to comment.