public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Simon Kagstrom <simon.kagstrom@netinsight.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ubifs: Correct dereferencing of files-after-symlinks
Date: Fri, 25 Sep 2009 14:05:57 +0200	[thread overview]
Message-ID: <20090925140557.4fc66638@marrow.netinsight.se> (raw)

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>
---
 fs/ubifs/ubifs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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;
-- 
1.6.0.4

             reply	other threads:[~2009-09-25 12:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-25 12:05 Simon Kagstrom [this message]
2009-09-28 14:59 ` [U-Boot] [PATCH] ubifs: Correct dereferencing of files-after-symlinks Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090925140557.4fc66638@marrow.netinsight.se \
    --to=simon.kagstrom@netinsight.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox