]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ubifs: Correct dereferencing of files-after-symlinks
authorSimon Kagstrom <simon.kagstrom@netinsight.net>
Fri, 25 Sep 2009 12:05:57 +0000 (14:05 +0200)
committerStefan Roese <sr@denx.de>
Mon, 28 Sep 2009 14:58:31 +0000 (16:58 +0200)
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 <simon.kagstrom@netinsight.net>
Signed-off-by: Stefan Roese <sr@denx.de>
fs/ubifs/ubifs.c

index b03ed0bb8e9287214fd9bbbac28cff0fdc1c0385..286739c3687834de0e93fa644bfdde1607510271 100644 (file)
@@ -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;