All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/2] fs: fat: cannot write to subdirectories
Date: Mon, 9 Jul 2018 08:07:47 +0200	[thread overview]
Message-ID: <af49bd8a-a95c-6660-e791-28ccb7b8e551@gmx.de> (raw)
In-Reply-To: <CAPnjgZ1HAPAXWgdUTj-sCOwh5Hz=c6pfCh87iaG10HRC7bCyiQ@mail.gmail.com>

On 07/09/2018 04:35 AM, Simon Glass wrote:
> Hi Heinrich,
> 
> On 1 July 2018 at 17:41, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>> fs_fat_write() is not able to write to subdirectories.
>>
>> Currently if a filepath with a leading slash is passed, the slash is
>> treated as part of the filename to be created in the root directory.
>>
>> Strip leading (back-)slashes.
>>
>> Check that the remaining filename does not contain any illegal characters
>> (<>:"/\|?*). This way we will throw an error when trying to write to a
>> subdirectory.
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>>  fs/fat/fat_write.c | 16 +++++++++++++++-
>>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> It would be great if we have filesystem tests. We do have the
> fs-test.sh script but it is not using pytest, so best not to build on
> it.

There is a write test for FAT in
lib/efi_selftest/efi_selftest_block_device.c.
See patch "efi_selftest: test writing to file".

I agree having tests independent of the EFI subsystem would be a good idea.

Best regards

Heinrich

  reply	other threads:[~2018-07-09  6:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02  0:41 [U-Boot] [PATCH v3 0/2] efi_loader: allow writing to FAT Heinrich Schuchardt
2018-07-02  0:41 ` [U-Boot] [PATCH v3 1/2] fs: fat: cannot write to subdirectories Heinrich Schuchardt
2018-07-09  2:35   ` Simon Glass
2018-07-09  6:07     ` Heinrich Schuchardt [this message]
2018-07-02  0:41 ` [U-Boot] [PATCH v3 2/2] efi_selftest: test writing to file Heinrich Schuchardt

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=af49bd8a-a95c-6660-e791-28ccb7b8e551@gmx.de \
    --to=xypron.glpk@gmx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.