diff options
author | Latchesar Ionkov <lucho@ionkov.net> | 2006-02-03 06:04:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-03 11:32:06 -0500 |
commit | 93c615feffbcea4f09ecee154f46062f6041776e (patch) | |
tree | e2f125d960d288cad271b72173f8cfd4476bcc11 /fs/9p | |
parent | 8e75f744289f0a1c38b669e39a489af460640881 (diff) |
[PATCH] v9fs: symlink support fixes
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>
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/vfs_inode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 91f552454c7..63e5b0398e8 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -886,8 +886,8 @@ static int v9fs_readlink(struct dentry *dentry, char *buffer, int buflen) | |||
886 | } | 886 | } |
887 | 887 | ||
888 | /* copy extension buffer into buffer */ | 888 | /* copy extension buffer into buffer */ |
889 | if (fcall->params.rstat.stat.extension.len < buflen) | 889 | if (fcall->params.rstat.stat.extension.len+1 < buflen) |
890 | buflen = fcall->params.rstat.stat.extension.len; | 890 | buflen = fcall->params.rstat.stat.extension.len + 1; |
891 | 891 | ||
892 | memcpy(buffer, fcall->params.rstat.stat.extension.str, buflen - 1); | 892 | memcpy(buffer, fcall->params.rstat.stat.extension.str, buflen - 1); |
893 | buffer[buflen-1] = 0; | 893 | buffer[buflen-1] = 0; |
@@ -951,7 +951,7 @@ static void *v9fs_vfs_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
951 | if (!link) | 951 | if (!link) |
952 | link = ERR_PTR(-ENOMEM); | 952 | link = ERR_PTR(-ENOMEM); |
953 | else { | 953 | else { |
954 | len = v9fs_readlink(dentry, link, strlen(link)); | 954 | len = v9fs_readlink(dentry, link, PATH_MAX); |
955 | 955 | ||
956 | if (len < 0) { | 956 | if (len < 0) { |
957 | __putname(link); | 957 | __putname(link); |