Revert "fs: fat: cannot write to subdirectories"
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Tue, 11 Sep 2018 06:59:01 +0000 (15:59 +0900)
committerAlexander Graf <agraf@suse.de>
Sun, 23 Sep 2018 19:55:29 +0000 (21:55 +0200)
This reverts commit 0dc1bfb7302d220a48364263d5632d6d572b069b.
The succeeding patch series will supersede it.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
fs/fat/fat_write.c

index 27e0ff66966c54a2eaf3843a7d6e46be996f24ae..3b77557b3ede57951c4e35e0d5d753fda845e903 100644 (file)
@@ -909,11 +909,9 @@ static int do_fat_write(const char *filename, void *buffer, loff_t size,
        volume_info volinfo;
        fsdata datablock;
        fsdata *mydata = &datablock;
-       int cursect, i;
+       int cursect;
        int ret = -1, name_len;
        char l_filename[VFAT_MAXLEN_BYTES];
-       char bad[2] = " ";
-       const char illegal[] = "<>:\"/\\|?*";
 
        *actwrite = size;
        dir_curclust = 0;
@@ -973,18 +971,6 @@ static int do_fat_write(const char *filename, void *buffer, loff_t size,
        }
        dentptr = (dir_entry *) do_fat_read_at_block;
 
-       /* Strip leading (back-)slashes */
-       while ISDIRDELIM(*filename)
-               ++filename;
-       /* Check that the filename is valid */
-       for (i = 0; i < strlen(illegal); ++i) {
-               *bad = illegal[i];
-               if (strstr(filename, bad)) {
-                       printf("FAT: illegal filename (%s)\n", filename);
-                       return -1;
-               }
-       }
-
        name_len = strlen(filename);
        if (name_len >= VFAT_MAXLEN_BYTES)
                name_len = VFAT_MAXLEN_BYTES - 1;