From: Simon Kagstrom Date: Fri, 25 Sep 2009 12:05:57 +0000 (+0200) Subject: ubifs: Correct dereferencing of files-after-symlinks X-Git-Tag: v2009.11-rc1~82^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef37c6835eac66206a9c7c11f0c7186f5d64bf91;p=kernel%2Fu-boot.git ubifs: Correct dereferencing of files-after-symlinks Files in directories which are symlinked to were not dereferenced correctly in last commit. E.g., with a symlink /boot/lnk -> /boot/real_dir loading /boot/lnk/uImage will fail. This patch fixes that by simply seeing to it that the target base directory has a slash after it. Signed-off-by: Simon Kagstrom Signed-off-by: Stefan Roese --- diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index b03ed0b..286739c 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -439,7 +439,7 @@ static unsigned long ubifs_findfile(struct super_block *sb, char *filename) continue; } /* Relative to cur dir */ - sprintf(buf, "%s%s", + sprintf(buf, "%s/%s", link_name, next == NULL ? "" : next); memcpy(symlinkpath, buf, sizeof(buf)); next = name = symlinkpath;